Extended instructions
8.5 Diagnostics (PROFINET or PROFIBUS)
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
353
You can use the ModuleStates instruction to return the status of all of the modules in a
PROFIBUS or PROFINET station.
Table 8- 129 ModuleStates instruction
laddr:=_word_in_,
mode:=_uint_in,
state:=_variant_inout);
ModuleStates retrieves the operational states
of I/O modules. After execution, the STATE
parameter contains the error state of each I/O
module in a bit list (for the assigned LADDR
and MODE). This information corresponds
with the module status seen in the STEP 7
diagnostics view.
The LADDR input of ModuleStates uses is a
hardware identifier of a distributed I/O station
and not of the head module itself. The
hardware identifier can be found by selecting
the entire station in the network view and then
looking in the hardware identifier section
under properties. It can also be found by
looking for "Hw_Device" and "Hw_DpSlave"
data types in the system constants tab in the
PLC tag table.
Table 8- 130 Data types for the parameters
Logical address (Identifier for the I/O modules)
MODE IN UInt Supports five modes of operation. The MODE input determines
which data will be returned to the location specified for STATE
information. The modes are as follows:
• 1: Module configuration active
• 2: Module defective
• 3: Module disabled
• 4: Module exists
• 5: Problem in Module