Devicestates Instruction - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents
Table 8- 117 Status of RET_VAL
RET_VAL (W#16#...)
0 to 9 LED state
8091
8092
8093
80Bx
8.5.4

DeviceStates instruction

You can use the DeviceStates instruction to return the states of all distributed I/O slave
devices connected to a specified distributed I/O Master.
Table 8- 118 DeviceStates instruction
LAD / FBD
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Description
0
LED does not exist
1
Off
2
Color 1 On (solid)
3
Color 2 On (Solid)
4
Color 1 flashing at 2 Hz
5
Color 2 flashing 2 Hz
6
Color 1 & 2 flashing alternatively at 2 Hz
7
Color 1 on (Tx/Rx)
8
Color 2 on (Tx/Rx)
9
State of the LED is not available
Device identified by LADDR does not exist
Device identified by LADDR does not support LEDs
LED identifier not defined
CPU identified by LADDR does not support the LED instruction
SCL
ret_val := DeviceStates(
laddr:=hw_io_in_,
mode:=_uint_in_,
state:=_variant_inout_);
Extended instructions
8.5 Diagnostics (PROFINET or PROFIBUS)
Description
DeviceStates retrieves the I/O device
operational states of an I/O subsystem. After
execution, the STATE parameter contains the
error state of each I/O device in a bit list (for the
assigned LADDR and MODE). This information
corresponds with the device status seen in the
STEP 7 diagnostics view.
The LADDR input of DeviceStates uses the
hardware identifier of a distributed I/O interface.
In the TIA portal, the hardware identifiers for a
PLC can be found by looking for
"Hw_IoSystem" data types in the system
constants tab in the PLC tag table.
347
Table of Contents
loading

Table of Contents