CANopen Low Level
1) Introduction
Nexto Xpress controllers contains a CAN bus interface compliant with CAN 2.0A and CAN 2.0B standards (11-bit and 29-bit identifiers). There are two traditional use cases for this interface:
• Use it with CANopen Manager protocol (exclusive of XP325 and XP340 models), allowing the PLC to communicate with CANopen slave I/O devices.
• Use it with CANopen Slave operation mode (feature introduced on firmware 1.7.49.0 for all XP3xx models), allowing to use the PLC as a non-programmable slave I/O device.
Additionally to these two standard use cases, there is a third (advanced) one:
• Use it for low level CAN communication
The low level CAN communication allows transmitting/receiving raw CAN messages, not using upper layer protocols like CANopen, J1939, etc... This can be useful for communication with devices that use custom/specific protocols over CAN. This use case works for all XP3xx models regardless of the presence of CAN interface on project treeview (which exists only on XP325 and XP340), but XP300 and XP315 requires firmware 1.7.49.0 or greater.
The low level CAN communication is implemented by a group of CAA libraries (the same ones used by upper layer protocols like CANopen, J1939, etc...), which must be included on the application as described below:
The basic functions used for communication are located on CAA Can Low Level Extern library (namespace "CL2"):
The complete documentation can be found on CODESYS Online Help:
2) Application example
The following example consists on two XP300 controllers (PLC1 and PLC2). The PLC1 sends a message named "123" (COB ID) containing one USINT (byte) element, which is received by PLC2 and moved to it`s outputs Q00 to Q07.
The application was developed with MasterTool v3.17 in Structured Text language, located on UserPrg POU. The code is commented step-by-step, explaining the functions structure. To start the test, set TRUE in "bEnable" variable for each application, which will configure the CAN network as 250 kbits/s and start the communication.