ifm
System Manual
ecomat
mobile
SmartController (CR2500) V05
CAN in the ecomatmobile controller
ifm CANopen library
83
8.7
ifm CANopen library
CANopen network configuration, status and error handling
For all programmable devices the CANopen interface of CoDeSys is used. Whereas the network
configuration and parameter setting of the connected devices are directly carried out via the
programming software, the error messages can only be reached via nested variable structures in the
CANopen stack. The documentation below shows you the structure and use of the network
configuration and describes the functions of the
ifm
CANopen device libraries.
The chapters CANopen support by CoDeSys (
→
page
), CANopen master (
→
), CAN
device (
→
page
) and CAN network variables (
→
) describe the internal functions of the
CoDeSys CANopen stacks and their use. They also give information of how to use the network
configurator.
The chapters concerning the libraries
ifm_CRnnnn_CANopenMaster_Vxxyyzz.lib
and
ifm_CRnnnn_CANopenSlave_Vxxyyzz.lib
describe all functions for error handling and polling the
device status when used as master or slave (CAN device).
NOTE
Irrespective of the device used the structure of the function interfaces of all libraries is the same. The
slight differences (e.g. CANOPEN_LED_STATUS) are directly described in the corresponding
functions.
It is absolutely necessary to use only the corresponding device-specific library. The context can be
seen from the integrated article number of the device, e.g.:
CR0020:
→
ifm_CR0020_CANopenMaster_V040003.lib
→
chapter Setup the target (
→
page
)
When other libraries are used the device can no longer function correctly.
8.7.1
CANopen support by CoDeSys
General information about CANopen with CoDeSys
CoDeSys
®
is one of the leading systems for programming control systems to the international
standard IEC 61131. To make CoDeSys
®
more interesting for users many important functions were
integrated in the programming system, among them a configurator for CANopen. This CANopen
configurator enables configuration of CANopen networks (with some restrictions) under CoDeSys
®
.
CANopen is implemented as a CoDeSys
®
library in IEC 61131-3. The library is based on simple basic
CAN functions called CAN driver.
Implementation of the CANopen functions as CoDeSys
®
library enables simple scaling of the target
system. The CANopen function only uses target system resources if the function is really used. To
use target system resources carefully CoDeSys
®
automatically generates a data basis for the
CANopen master function which exactly corresponds to the configuration.
From the CoDeSys
®
programming system version 2.3.6.0 onwards an
ecomat
mobile
controller can
be used as CANopen master and slave (CAN device).