The CANopen state of a device can be interrogated in the application in three different ways:
GET_STATE function block ( CAA CiA 405 library)
<name in device tree>.CANopenState property ( 3S CANopenStack library)
<name in device tree>.GetDeviceState method ( CAA Device Diagnosis library)
The method does not return a CANopen state, but the information whether the device is running or not. A mapping table between CANopenState and DEVICE_STATE is found in the library documentation of CANopenStack.
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).