CANopen is an open industry-standard communication protocol and device profile specification (EN 50325-4) that is based on the Controller Area Network (CAN) protocol. The “Layer 7” protocol was developed for embedded networking applications and defines communication and device functions for CAN-based systems.
CANopen supports both cyclic and event driven communication, allowing you to reduce bus load to a minimum but still maintain short reaction times.
PDOs are objects which provide the communication interface with process data and enable them to be exchanged in real time. The set of PDOs on a CANopen device describes the implicit exchanges between this device and its communication partners on the network. The exchange of PDOs is authorized when the device is in ‘OPERATIONAL’ mode.
There are two types of PDOs:
Transmit PDO (TPDO): PDO transmitted by the device
Receive PDO (RPDO): PDO received by the device
The TM3 CANopen bus coupler supports three types of PDO transmission mode:
Transfer Code Type |
Transmission Mode |
Description |
---|---|---|
0 |
Acyclic - Synchronous |
Send PDO on first message following an event |
1-240 |
Cyclic - Synchronous |
Send PDO every x messages, where x can be configured from 1 to 240 |
255 (Default) |
Asynchronous |
Send PDO on event |
A further two options are associated with event-triggered PDOs:
Inhibit Time: The Inhibit Time utility is used to define a minimum time delay before transmission of a new PDO. This avoids overloading the bus where a significant number of events occur in rapid succession. The Inhibit Time is expressed in multiples of 100 μs.
This feature is available for Type 255 (Asynchronous) transfer.
This table shows an example of values:
Value (dec) |
Timing (ms) |
---|---|
0 |
0 |
10 |
1 |
100 |
10 |
1000 |
100 |
10000 |
1000 |
65535 |
6553.5 |
: The is used to define an expiry time delay where transmission of a PDO will be forced, even if there has been no change in status. The is expressed in milliseconds.
This feature is available for Type 255 (Asynchronous) transfer.
This table shows an example of values:
Value (dec) |
Timing (ms) |
---|---|
0 |
0 (deactivates timer) |
10 |
10 |
100 |
100 |
1000 |
1000 |
10000 |
10000 |
65535 |
65535 |
An SDO allows a device's data to be accessed by using explicit requests. The SDO service is available when the device is in ‘OPERATIONAL’ or ‘PRE-OPERATIONAL’ state.
There are two types of SDO:
Read SDOs (download SDO)
Write SDOs (upload SDO)
The SDO protocol is based on a Client/Server model. For a Download SDO, the client (typically the controller) sends a request indicating the object to be read. The server (in this case the bus coupler) returns the data contained within the object. For an Upload SDO, the client (typically the controller) sends a request indicating the object to be written to and the desired value. After the object has been updated, the server (in this case the bus coupler) returns a confirmation message.
If an SDO is not processable by the server (bus coupler), the server returns an error code (Abort Code). This applies to both Download and Upload SDO. If the server does not respond within a pre-configured time period (SDO Timeout), the client will issue an SDO timeout abort code.
Error control protocols are used to detect communication errors on the network. There are two protocols: node-guarding and heartbeat. These two monitoring mechanisms are especially important in the CANopen system. Devices connected to the bus do not regularly indicate their presence in operating mode, especially when commanded by .
In this protocol, the NMT master (typically the controller) polls each NMT device (bus coupler, for example) at regular time intervals, known as 1029H, and generates a life guarding event. For the bus coupler, it transitions to the state as configured in the object (if object is left as default), fallback management is engaged, and guarding event is generated. is defined as follow: = x . The object contains the guard time parameter expressed in milliseconds. The object contains the parameter. and can be configured differently for different devices.
. The device responds with its NMT state. If the device does not receive a poll after a defined period, called , this device transitions to the state as configured in the objectWhen one of the two parameters
or is set to 0 (default configuration), the device does not perform monitoring. To activate monitoring over time, you must enter a value (minimum 2) in the object and specify a time in milliseconds in the object .Typical values for the
parameter lie between 200 ms and 2 s.In order to help maintain a more reliable and secure operation, you must enter a
(object ) with a value of 2 or greater. If a value of 1 is used, and should a delay occur due to the processing of high priority messages or internal processing on the node-guarding master, the device may inadvertently transition to the state as configured in the object .WARNING | |
---|---|
Monitoring is performed in the following way:
Phase |
Description |
---|---|
1 |
The master sets Guarding-CobID of the devices to be monitored. (or request messages) on the |
2 |
The devices concerned respond by sending the message. This message contains the of the device and the , which changes after each message. |
3 |
The NMT (Network Management Telegram) master compares the and information: if they are not in the expected state or if no response is received, the NMT master considers that an error has been detected on the device. |
The network state of the device is indicated in the seven remaining bits:
Network state |
Response (hex) |
---|---|
‘STOPPED’ |
04H or 84H |
‘PRE-OPERATIONAL’ |
7FH or FFH |
‘OPERATIONAL’ |
05H or 85H |
In this protocol, the producer transmits a CANopen state as configured in the object 1029H, fallback management is engaged and event is generated.
message periodically, depending on the parameter (in milliseconds) configured in object . Devices responsible for monitoring this message will have a parameter (in milliseconds), configured in object . If the producer message is not received within the configured time of the consumer devices, the devices generates a event. For the bus coupler, it transitions to theThe message
indicates the device status on a byte, composing of:The most significant bit is reserved and always has a value of 0
The 7 least significant bits provide the status for the device producing the
messageThe possible values are as follows:
Status of the Producer |
Value (Decimal) |
---|---|
BOOT-UP |
0 |
STOPPED |
4 |
OPERATIONAL |
5 |
PRE-OPERATIONAL |
127 |