Diagnosis in the Application
CANopen State
The CANopen state of a device can be interrogated in the application in three different ways:
GET_STATEfunction block (CAA CiA 405library)<name in device tree>.CANopenStateproperty (3S CANopenStacklibrary)<name in device tree>.GetDeviceStatemethod (CAA Device Diagnosislibrary)The method does not return a CANopen state, but the information whether the device is running or not. A mapping table between
CANopenStateandDEVICE_STATEis found in the library documentation ofCANopenStack.
The CANopen Manager also has properties to interrogate whether or not all required and optional slaves are in the OPERATIONAL state. Note that these properties are set only one time after the configuration phase if the condition applies. If a slave fails afterwards, then these properties remain set accordingly.
Furthermore, the CANopen state can also be set by means of the function block NMT (library CAA CiA 405) or the method <name in device tree>.SetCommunicationState (CAA Device Diagnosis library).
CANopen Kernel State
An interrogation of the CANopen kernel state can be used to detect a bus error, a configuration error, or a monitoring error.
The state can be interrogated by means of the property <name of CANopen Manager in device tree>.KernelState or the function block GET_CANOPEN_KERNEL_STATE (CAA CiA 405 library).
Emergency
You can receive emergency telegrams by means of CIA405 function blocks.
RECV_EMCY: Receiving of all emergencies of all devices of the bus strandRECV_EMCY_DEV: Receiving of the emergencies of a specific device
Predefined Error Field and Error Register
The objects of the object directory of a slave can be read with the SDO_READ4 and SDO_READ_DATA CiA405 function blocks.
Safety Diagnosis
In the case of Safety, the implicitly created function blocks with the prefix "S_" provide corresponding outputs for diagnosis. With these functions blocks, you can define whether the SRDO communication to a slave is active or whether the safe state has been reached.
Furthermore, the function block also provides inputs to acknowledge errors of an individual slave as well as temporarily deactivate the SRDO communication.
For more information, see: CANopenManagerSIL2 and CANRemoteDeviceSafe (FB)