CANopen Node

This section describes the API functions of the CANopen core module. These functions are implemented within the source file: co_core.c/h

The class CO.NODE is defined within co_core.h and is responsible for the overall node management functions. The node is the central data point of an CANopen device. The following data members are in this class:


Data MemberTypeDescription
DirCO_DIRThe object directory object
IfCO_IFThe bus interface object
EmcyCO_EMCYThe node emergency object
TmrCO_TMRThe timer manager object
NmtCO_NMTThe node network management object
Sdo[]CO_SDOThe SDO server object array
SdoBufCPU_INT08U *Reference to the SDO transfer buffer
RPdo[]CO_RPDOThe receive PDO object array
TPdo[]CO_TPDOThe transmit PDO object array
TMap[]CO_TPDO_LINKThe transmit PDO mapping link array
SyncCO_SYNCThe SYNC management object
ErrorCO_ERRInternal error identification code
NodeIdCPU_INT08UThe CANopen node ID


Note: The data within these structures must never be manipulated without the corresponding class member functions. This will lead to unpredictable behavior of the CANopen node.

During calling a member function of a class, the first parameter must be a reference to a corresponding object. This should be done as shown in the following examples:


CO_NODE  AppNode;                  /* allocation of the application node    */
:
CONodeInit (&AppNode       ,...);  /* call member function of class CO_NODE */
CODirFind  (&(AppNode.Dir) ,...);  /* call member function of class CO_DIR  */
COIfSend   (&(AppNode.If)  ,...);  /* call member function of class CO_IF   */
COEmcySet  (&(AppNode.Emcy),...);  /* call member function of class CO_EMCY */
COTmrCreate(&(AppNode.Tmr) ,...);  /* call member function of class CO_TMR  */
CONmtReset (&(AppNode.Nmt) ,...);  /* call member function of class CO_NMT  */
:


Note, that in all application source files, which needs to call one or more CANopen API functions, the header file co_core.h must be included. This header file collects and includes all other header files.