100
ifm
System Manual
ecomat
mobile
SmartController (CR2500) V05
CAN in the ecomatmobile controller
ifm CANopen library
8.7.4
CAN device
CAN device is another name for a CANopen slave or CANopen node.
A CoDeSys programmable controller can also be a CANopen slave in a CAN network.
Functionality
The CAN device library in combination with the CANopen configurator provides the user with the
following options:
•
In CoDeSys configuration of the properties for nodeguarding/heartbeat, emergency, node ID and
baud rate at which the device is to operate.
•
Together with the parameter manager in CoDeSys, a default PDO mapping can be created which
can be changed by the master at runtime. The PDO mapping is changed by the master during the
configuration phase. By means of mapping IEC variables of the application can be mapped to
PDOs. This means IEC variables are assigned to the PDOs to be able to easily evaluate them in
the application program.
•
The CAN device library provides an object directory. The size of this object directory is defined
while compiling CoDeSys. This directory contains all objects which describe the CAN device and
in addition the objects defined by the parameter manager. In the parameter manager only the list
types parameters and variables can be used for the CAN device.
•
The library manages the access to the object directory, i.e. it acts as SDO server on the bus.
•
The library monitors nodeguarding or the heartbeat consumer time (always only of one producer)
and sets corresponding error flags for the application.
•
An EDS file can be generated which describes the configured properties of the CAN device so that
the device can be integrated and configured as a slave under a CAN master.
The CAN device library explicitly does not provide the following functionalities described in CANopen
(all options of the CANopen protocol which are not indicated here or in the above section are not
implemented either):
•
Dynamic SDO and PDO identifiers
•
SDO block transfer
•
Automatic generation of emergency messages. Emergency messages must always be generated
by the application using the function CANx_SLAVE_EMCY_HANDLER (
→
page
) and the
function CANx_SLAVE_SEND_EMERGENCY (
→
page
). To do so, the library
ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB
provides these functions.
•
Dynamic changes of the PDO properties are currently only accepted on arrival of a StartNode
NMT message, not with the mechanisms defined in CANopen.