98
ifm
System Manual
ecomat
mobile
SmartController (CR2500) V05
CAN in the ecomatmobile controller
ifm CANopen library
The object directory is accessed by the application via an array with the following structure:
Structure element Description
dwIdxSubIdxF Structure
of the component 16#iiiissff:
iiii – index (2 bytes, bits 16-31), Idx
ss – sub-index (1 byte, bits 8-15), SubIdx
ff – flags (1 byte, bits 0-7), F
Meaning of the flag bits:
bit 0: write
bit 1: content is a pointer to an address
bit 2: mappable
bit 3: swap
bit 4: signed value
bit 5: floating point
bit 6: contains more sub-indices
dwContent contains
the
contents of the entry
wLen
length of the data
byAttrib
initially intended as access authorisation
can be freely used by the application of the master
byAccess
in the past access authorisation
can be freely used by the application of the master
On the platform CoDeSys has no editor for this object directory.
The EDS file only determines the objects used to create the object directory. The entries are always
generated with length 4 and the flags (least significant byte of the component of an object directory
entry dwIdxSubIdxF) are always given the value 1. This means both bytes have the value 16#41.
If an object directory is available in the master, the master can act as SDO server in the network.
Whenever a client accesses an entry of the object directory by writing, this is indicated to the
application via the flag OD_CHANGED in the function CANx_MASTER_STATUS (
→
page
evaluation this flag must be reset.
The application can use the object directory by directly writing to or reading the entries or by pointing
the entries to IEC variables. This means: when reading/writing to another node these IEC variables
are directly accessed.