101BExtended instructions
8.5 Diagnostics (PROFINET or PROFIBUS)
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
285
Parameter and type
Data type
Description
RET_VAL
OUT
Int
Status (condition code)
STATE
1
InOut
Variant
Buffer containing the error status of each device
Summary bit: Bit 0 =1, if one of the state bits of the I/O devices
is 1
State bit: State of I/O device with station number
n
according to
the selected MODE. For example, MODE = 2 and bit 3 = 1
means station 3 is faulty.
1
The length required is dependent on the I/O device, with a maximum of 128 bits.
Table 8- 110 Condition codes
RET_VAL ( W#16#...)
Description
0
No error
8091
Device identified by LADDR does not exist.
8092
Device identified by LADDR does not address an I/O device.
80Bx
ModuleStates instruction not supported by this CPU for this LADDR.
8452
The complete state data is too large for STATE. The STATE parameter contains a partial
result.
8.5.4
GET_DIAG instruction
Table 8- 111 GET_DIAG instruction
LAD / FBD
SCL
Description
ret_val := GET_DIAG(
mode:=_uint_in_,
laddr:=_word_in_,
cnt_diag=>_uint_out_,
diag:=_variant_inout_,
detail:=_variant_inout_);
Reads the diagnostic information from a
specified hardware device.
Table 8- 112 Data types for the parameters
Parameter and type
Data type
Description
MODE
IN
UInt
Mode
LADDR
IN
HW_ANY (Word)
Identification number of the hardware device
DIAG
InOut
Variant
Diagnostic information according to diagnostic mode
DETAIL
InOut
Variant
Diagnostic detail according to diagnostic mode
RET_VAL
OUT
Int
Execution result / error message
CNT_DIAG
OUT
UInt
Count of the returned diagnostic details