6.5.4
Diagnostic instructions to monitor the hardware
6.5.4.1
Reading the states of the LEDs on the CPU
The LED instruction allows your user program to determine the state of the LEDs on the
CPU. You can use this information for programming a tag for your HMI device.
Table 6- 25
LED instruction
LAD / FBD
SCL
ret_val := #LED(
6.5.4.2
Instructions for reading the diagnostic status of the devices
STEP 7 also includes instructions for reading the status information that is provided by the
hardware devices on your network.
Table 6- 26
Diagnostic instructions
LAD / FBD
Easy Book
Manual, 03/2014, A5E02486774-AF
laddr:=_hw_io_in_,
LED:=_uint_in_);
SCL
ret_val := #GET_DIAG(
mode:=_uint_in_,
laddr:=_hw_any_in_,
channel:=_uint_in_,
cnt_diag=>_uint_out_,
diag:=_uint_inout_,
detail:=_variant_inout_);
ret_val := DeviceStates(
laddr:=hw_io_in_,
mode:=_uint_in_,
state:=_variant_inout_);
ret_val := ModuleStates(
laddr:=_hw_io_in_,
mode:=_uint_in,
state:=_variant_inout);
6.5 Easy to monitor and test your user program
Description
RET_VAL returns the following LED states for the CPU
RUN/STOP: green or yellow
•
Error: red
•
MAINT (maintenance): yellow
•
Link: green
•
Tx/Rx (transmit/receive): yellow
•
Description
The GET_DIAG instruction reads the
diagnostic information from a specified
hardware device.
The DeviceStates instruction reads the status
of PROFINET or PROFIBUS devices.
The ModuleStates instruction reads the
status of PROFINET or PROFIBUS modules.
Programming made easy
117