CIA405.GET_STATE (FB)

( CAA_Cia405.Library)

Function block CIA405.GET_STATE returns the current state of a CANopen network device.

Extends CIA405.CIA405BASE.

Input:

NETWORK

USINT

see CIA405.CIA405BASE

ENABLE

BOOL

see CIA405.CIA405BASE

TIMEOUT

UDINT

see CIA405.CIA405BASE 

DEVICE

CIA405.DEVICE

Addressed device; 0 means local device

range: 1 … 127

initial: 0

Output:

CONFIRM

BOOL

see CIA405.CIA405BASE

ERROR

CIA405.CANOPEN_

KERNEL_ERROR

see CIA405.CIA405BASE

STATE

CIA405.DEVICE_STATE

Device state

range: 0 … 7

initial: 0

插图 566: Request/Response diagram

If the state is not known, the function block returns with the state UNKNOWN. This will occur, if the device is not guarded and Heartbeat is not running. If Guarding is performed and the device does not answer or it is known for other reasons, that the device is not available, the function returns the state NOT_AVAIL. If DEVICE is 0 or equal to the own Node-ID, the function block returns the state of the local communication process.

  • Data output STATE is valid only if CONFIRM is TRUE. If CONFIRM is FALSE, the data output is invalid and may contain any value.
  • The request for data is initiated only once with the rising edge at ENABLE. Another request is initiated not before the next rising edge at ENABLE is recognized.
  • For behavior of ENABLE and CONFIRM see chapter “Control mechanism”.
  • For inputs NETWORK and TIMEOUT see chapter Additional parameters .
  • In case of an error during execution of the function block it is defined to deliver STATE = UNKNOWN (6) with CONFIRM = TRUE and ERROR = 0.