Network Management
The network management (NMT) defines the communication behavior of a CANopen device and consists of the states initialization, pre-operational, operational and stopped.
When a device is switched on or restarted, the device automatically switches to the initialization state. When the initialization state is completed, the device automatically switches to pre-operational state.
From this state any other state can be assumed. For sample, only a single CAN message is required to make the devices start:
Start_Remote_Node: Identifier 0, two data bytes: 0x01, 0x00.
This message transfers the devices to the operational state.
The following diagram shows which states a CANopen device can assume:
- Initialization
The device automatically switches to the initialization state. When the initialization state is completed, the device automatically switches to pre-operational state. - Pre-Operational
After the initialization the device automatically switches to pre-operational state, i.e. without an external command. In this state the service data objects (SDO) are already active, and the device can be configured. The process data objects (PDO) are still locked. - Operational
In operational state the process data objects (PDO) are active.
If the device is no longer able to set outputs, read inputs or communicate due to external influences (e.g. CAN fault, no output voltage) or internal influences (e.g. K-bus error), it tries to send a corresponding emergency message. The device then assumes error state and switches back to pre-operational state. This enables the NMT status machine of the master to detect fatal errors immediately. - Stopped
In stopped state (previously prepared) no communication with the device is possible. Only network management (NMT) messages are received. The outputs go into the fault state.
State transitions
State transitions are executed with a CAN message. The CAN messages have a very simple structure:
CAN identifier 0, with two bytes of data content.
- The first data byte contains the command specifier (cs),
- the second data byte contains the node address (node ID); node address 0 addresses all nodes (broadcast).
11 bit identifier | 2 byte of user data | |||||||
---|---|---|---|---|---|---|---|---|
0x00 | cs | Node ID |
|
|
|
|
|
|
The following table provides an overview of all possible state transitions and the corresponding command specifiers (cs). The diagram shown above, which illustrates the states, is part of the overview:
State transition | Command Specifier cs | Explanation |
---|---|---|
(1) | -- | The initialization state is reached automatically at power-up |
(2) | -- | After initialization the pre-operational state is reached automatically - this involves sending the boot-up message. |
(3), (6) | cs = 1 = 0x01 | Start_Remote_Node. |
(4), (7) | cs = 128 = 0x80 | Enter_Pre-Operational. |
(5), (8) | cs = 2 = 0x02 | Stop_Remote_Node. |
(9) | cs = 129 = 0x81 | Reset_Node. |
(10) | cs = 130 = 0x82 | Reset_Communication. |
Sample 1
The following telegram puts all the modules in the network into the error state (outputs in a safe state):
11 bit identifier | 2 byte of user data | |||||||
---|---|---|---|---|---|---|---|---|
0x00 | 0x02 | 0x00 |
|
|
|
|
|
|
Sample 2
The following telegram is used to reset (restart) node 17:
11 bit identifier | 2 byte of user data | |||||||
---|---|---|---|---|---|---|---|---|
0x00 | 0x81 | 0x11 |
|
|
|
|
|
|