Device statePermalink

  1. Open one of the IEC application code editors.

  2. Type the device's name as it is written in the device tree, followed by a dot (".").

  3. Select the method ‎GetDeviceState‎ from the context menu or type the name of the method on yourself.

    Device_Diagnosis – General_Diagnosis_State
  4. Assign the function’s parameters.

eError_DED_ERROR

Scope

Name

Type

Comment

Return

GetDeviceState

DEVICE_STATE⮫ Further information

Current device state

Output

xDiagnosisInfoAvailable

BOOL

If TRUE, diagnosis messages are available regarding the concerning device (= node).

Output

eError

ERROR⮫ Further information

Type of the return values of all methods and functions of library CAA Device Diagnosis

Table 1032: Enumeration DEVICE_STATE (part of the library CAA Device Diagnosis (DED))

Name

Type

Initial

Icon in AB

Comment

UNKNOWN

INT

0

The device is in state unknown.

Example: No supervision mechanism active

STOPPED

INT

1

The device is stopped.

RUNNING

INT

2

Running_False_1
Running_False_2
Running_True_2

The device is running.

ERROR

INT

3

The device is in error state.

DISABLED

INT

4

The device is disabled in device tree.

NOT_CONFIGURED

INT

5

The device has not been yet configured by the stack.

Example: Configuration phase not yet started

CONFIGURED

INT

6

The device has been configured by the stack.

Example: Configuration phase finished but the device is not in running state

NOT_FOUND

INT

7

Not_Found_1

The device was not found on bus.

Table 1033: Enumeration ERROR (part of the library CAA Device Diagnosis (DED))

Name

Type

Initial

Comment

NO_ERROR

INT

0

No error

FIRST_ERROR

INT

1300

First library-specific error

TIME_OUT

INT

1301

Timeout occured.

ABORT

INT

1302

Operation was aborted.

REF_INVALID

INT

1303

The interface reference was invalid.

NOT_SUPPORTED

INT

1304

The function is not supported.

ERROR_IO

INT

1305

A general I/O configuration error occured.

PARAM_INVALID

INT

1306

Invalid parameter

NODE_NOT_EXISTING

INT

1307

The specified node does not exist.

NO_MEMORY

INT

1308

Dynamic memory allocation is disabled, or system is out of memory.

ADR_NOT_FOUND

INT

1309

The specified I/O address is not valid.

INST_NOT_FOUND

INT

1310

There is no associated [Device] instance for the specific I/O address.

NO_DATA

INT

1311

There is no data available.

OPERATION_INVALID

INT

1312

Operation not possible due to the current state

FIRST_MF

INT

1350

First manufacturer-specific error

LAST_ERROR

INT

1399

Last error