Layer Setting Services (LSS)
Interconnection in a CANopen network
As mentioned earlier, two conditions must be met for the interconnection of CANopen devices within a network:
- All devices must use the same baud rate, and
- All CANopen node IDs must be unique.
In the early days of CANopen, the node ID and baud rate could be set using DIP switches on the devices. Nowadays, of course, such settings are stored in non-volatile memory. The CANopen specification DS-306: Layer Setting Services (LSS) describes how these important values can be set via the bus using a simple protocol. A prerequisite for using LSS, in addition to software support from the node itself, is a 1:1 wired connection to the node. The baud rate and node ID can then be set via a dialogue. COB-ID 0x7E5 is used for CAN messages to the device; the device responds to this via COB-ID 0x7E4. LSS messages are always the full 8 bytes long. Unused bytes are reserved and must be initialised to 0.
To establish contact with the CANopen device to be configured, the “Global Switch Mode” command is sent:

This command puts the device into LSS configuration mode. Unfortunately, this command does not return a confirmation response. The system integrator can therefore only determine whether the device has responded by sending the following command. The node ID is then requested via the ‘Inquire Node-ID’ message:

If successful, the device responds with:

If there is no response, the device does not support LSS or the baud rate is incorrect. If the baud rate is not known at the start, the above message sequence must be repeated for all possible CANopen baud rates until the device sends a valid acknowledgement.
The “Configure Node-ID” message is then used to configure the new node-ID:

A possible error code is included in the node’s response:

Error code 0 indicates a successful change; error code 1 indicates an invalid CANopen node ID; the other error codes are reserved. The ‘Error Extension’ contains vendor-specific information, but this is only valid for error code 0xFF.
If everything went well, the baud rate can be configured using the ‘Configure Bit Timing Parameters’ message:

The standardised CANopen baud rates are as follows:
| Baud rate table 0x00 | |
|---|---|
| Table index | Baud rate |
| 0 | 1000 kBit/s |
| 1 | 800 kBit/s |
| 2 | 500 kBit/s |
| 3 | 250 kBit/s |
| 4 | 125 kBit/s |
| 5 | Reserved |
| 6 | 50 kbit/s |
| 7 | 20 kBit/s |
| 8 | 10 kBit/s |
Once again, the node reports back:

Error code 0 indicates a successful change; error code 1 indicates an invalid baud rate; the other error codes are reserved. The ‘Error Extension’ contains vendor-specific information, but this is only valid for error code 0xFF.
Now that the CANopen node ID and baud rate have been configured, these settings must be saved using the “Store Configuration” message:

Here too, a possible error code forms part of the node response:

Error code 0 indicates successful storage; error code 1 indicates that the device does not support the storage of values; error code 2 indicates a problem accessing the storage medium; the other error codes are reserved. The “Error Extension” contains vendor-specific information, but this is only valid for error code 0xFF. Finally, the device is returned from configuration mode to normal mode via “Switch Mode Global”:

Once the CANopen node has been physically switched off and on again, or at least rebooted, the device will operate with the new settings.





