108
ifm
System Manual
ecomat
mobile
SmartController (CR2500) V05
CAN in the ecomatmobile controller
ifm CANopen library
8.7.5
CAN network variables
General information
Network variables
Network variables are one option to exchange data between two or several controllers. For users the
mechanism should be easy to use. At present network variables are implemented on the basis of CAN
and UDP. The variable values are automatically exchanged on the basis of broadcast messages. In
UDP they are implemented as broadcast messages, in CAN as PDOs. These services are not
confirmed by the protocol, i.e. it is not checked whether the receiver receives the message. Exchange
of network variables corresponds to a "1 to n connection" (1 transmitter to n receivers).
Object directory
The object directory is another option to exchange variables. This is a 1 to 1 connection using a
confirmed protocol. The user can check whether the message arrived at the receiver. The exchange is
not carried out automatically but via the call of functions from the application program.
→
chapter The object directory of the CANopen master (
→
page
)
Configuration of CAN network variables
To use the network variables with CoDeSys you need the libraries
3s_CanDrv.lib
,
3S_CANopenManager.lib
and
3S_CANopenNetVar.lib
. You also need the library
SysLibCallback.lib
.
CoDeSys automatically generates the required initialisation code and the call of the network blocks at
the start and end of the cycle.
Settings in the target settings
►
Select the dialogue box [Target settings].
►
Select the tab [Network functionality].
►
Activate the check box [Support network variables].
►
Enter the name of the requested network, here CAN, in [Names of supported network interfaces].
►
To use network variables you must also add a CAN master or CAN slave (device) to the controller
configuration.