Download CANopen Slave Software Manual (PDF-File)

Transcript
CANopen-Slave
The COB identifiers of the PDOs, the PDO mapping and a number of additional parameter can be
configured by the application as well as by a CANopen manager (dynamic mapping).
The communication between the application and the CANopen library is based on a procedural
interface, the asynchron communication from the CANopen library to the application is event driven
based on callback handlers.
The following steps are necessary creating a virtual slave node and make this node available for
configuration and control by a CANopen manager and communication with further CANopen slaves.
1. Initialization of the CAN bus and start of the NMT daemon by calling canOpenCreateNetwork()
or canOpenCreateNetworkEx().
2. Initialization of the virtual slave by attaching the node event handler and defining the entries of the
object directory in the Communication Profile Area calling canOpenCreateNodeEx().
3. Creation of additional entries in the Manufacturer Specific Area and the Standardized Device
Profile Area of the object directory by calling canOpenExtendDictionary(). Initializion of these
entries and assignment of the object event handler by calling canOpenInitDictionary() or
canOpenInitDictionaryTs(). Alternatively you can use a set of macros to ease the programming
effort.
4. Creation and initialization of the PDOs by calling canOpenDefinePDO(). Alternatively you can
use a set of macros to ease the programming effort.
5. Change the node state to Pre-Operational by calling canOpenActivateNode().
6. If the node state changes to Operational, PDOs can be exchanged with other CANopen slave
nodes. PDO communication is different for synchronous and asynchronous PDOs and depends on
the configured PDO communication parameter:
CANopen Slave
Software Manual • Doc. No.: C.2002.21 / Rev. 2.2
Page 9 of 65