Object Directory Table

Object Directory Table

This section describes the configuration table representing the CANopen object directory. This is the central element of the CANopen node. This table can be placed in RAM or in ROM. The placement decides, which access type is possible with direct entries. Most likely this table is placed in ROM, because RAM is in most cases the limited resource.


const CO_OBJ AppObjDir[] = {
    { <ObjEntryKey_0>, <ObjTypeRef_0>, <ObjData_0> }, /* first object entry */
          :
    { <ObjEntryKey_N>, <ObjTypeRef_N>, <ObjData_N> }, /* last object entry  */
 
    CO_OBJ_DIR_ENDMARK
};


Each line represents a single object entry definition. The collection of object entries shall be sorted in ascending order in index and subindex.

The following sections describes the details of the table members.

Object Entry Key

The object entry key [CPU_INT32U] shall be constructed with the following macro:

CO_DEV(<index>, <subindex>, <specification>)

The index is a 16bit value with possible range from 0x0000 to 0xFFFF

The subindex is a 8bit value with possible range from 0x00 to 0xFF

Note: to be compliant to the CANopen specification, the defined index and subindex ranges shall be considered.

The object specification shall be set to a bitwise disjunction of the listed values for object entry size and the object access mode.

Object Entry SizeDescription
CO_UNSIGNED8CANopen Datatype: UNSIGNED8
CO_UNSIGNED16CANopen Datatype: UNSIGNED16
CO_UNSIGNED32CANopen Datatype: UNSIGNED32
CO_SIGNED8CANopen Datatype: SIGNED8
CO_SIGNED16CANopen Datatype: SIGNED16
CO_SIGNED32CANopen Datatype: SIGNED32
CO_DOMAINCANopen Datatype: DOMAIN
CO_STRINGCANopen Datatype: STRING

Object entry access mode field shall be set to one of the following values:

Object Access ModeDescription
CO_OBJ____R_Read Only
CO_OBJ_____WWrite Only
CO_OBJ____RWRead/Write
CO_OBJ___PR_Read Only, PDO Map
CO_OBJ___P_WWrite Only, PDO Map
CO_OBJ___PRWRead/Write, PDO Map
CO_OBJ__N_R_Read Only, + Node-Id
CO_OBJ__N__WWrite Only, - Node-Id
CO_OBJ__N_RWRead/Write, +/- Node-Id
CO_OBJ__NPR_Read Only, PDO Map, + Node-Id
CO_OBJ__NP_WWrite Only, PDO Map, - Node-Id
CO_OBJ__NPRWRead/Write, PDO Map, +/- Node-Id
CO_OBJ_D__R_Read Only, Direct Access
CO_OBJ_D___WWrite Only, Direct Access
CO_OBJ_D__RWRead/Write, Direct Access
CO_OBJ_DN_R_Read Only, + Node-Id, Direct Access
CO_OBJ_DN__WWrite Only, - Node-Id, Direct Access
CO_OBJ_DN_RWRead/Write, +/- Node-Id, Direct Access

Note: The access types read only, write only and read/write specifies the possible access types from the CANopen network to that object entry. The application is always able to read and write the object entry.

When placing the object entry table in read only memory (with keyword "const"), the direct access modes (tread pointer as object entry value), are limited to read only access, even by the application.

Object Type Reference

The object entry type structure reference [CO_OBJ_TYPE *] shall be set to one of the following values:

Object TypeDescription
0 (zero)Basic type, no special handling
CO_TASYNCAsynchronous PDO signal entry
CO_TDOMAINDomain entry
CO_TEMCYEMCY history entry
CO_TEVENTPDO event timer entry
CO_THEARTBEATHeartbeat entry
CO_TPARAParameter group store/restore entry
CO_TPDOIDDynamic PDO identifier entry
CO_TPDOMAPDynamic PDO mapping entry
CO_TPDONUMDynamic PDO number of mapping entries
CO_TPDOTYPEDynamic PDO transmission type entry
CO_TSDOIDDynamic SDO identifier entry
CO_TSTRINGUnlimited read only string

Object Data Reference

The object data reference [CPU_INT32U] shall be set in dependence to the object flags and the object type structure reference to different values.

Object TypeObject FlagsRequired Content in Data Pointer
0 (zero)CO_OBJ__xxxxaddress of variable
CO_OBJ_Dxxxxvalue in data pointer
CO_TASYNCN/Aaddress of variable
CO_TDOMAINaddress of domain info structure
CO_TEMCYaddress of EMCY history entry
CO_TEVENTaddress of variable
CO_THEARTBEATaddress of variable
CO_TPARAaddress of parameter group info structure
CO_TPDOIDaddress of variable
CO_TPDOMAPaddress of variable
CO_TPDONUMaddress of variable
CO_TPDOTYPEaddress of variable
CO_TSDOIDaddress of variable
CO_TSTRINGstart address of string