DeviceState

Each namespace in the TwinCAT OPC UA Server contains a DeviceState object.

DeviceState 1:

This object indicates the state of the lower-level ADS device by means of various properties.

typedef enum 
{
  UADEV_NOTINIT = 0x0100,
  UADEV_STARTING = 0x0110,
  UADEV_CONNECTED = 0x0120,
  UADEV_SHUTDOWN = 0x0130,
  UADEV_ERROR = 0xF000
}UaDeviceState;

If the device is in an ERROR state, the ErrorCode Property returns the following values:

#define UA_DEVSTATE_INVALID_STATE 0x80EB0010
#define UA_DEVSTATE_CREATE_NS_FAILED 0x80EB0011
#define UA_DEVSTATE_LOAD_NS_FAILED 0x80EB0012
#define UA_DEVSTATE_INVALID_IO_SETTING 0x80EB0100

A corresponding error message is displayed in the ErrorMessage Property.