Académique Documents
Professionnel Documents
Culture Documents
https://support.industry.siemens.com/cs/ww/en/view/98210758
Warranty and liability
Note The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The Application
Examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are used correctly. These Application Examples do not
relieve you of the responsibility to use safe practices in application, installation,
operation and maintenance. When using these Application Examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
Application Examples at any time without prior notice.
If there are any deviations between the recommendations provided in these
Application Examples and other Siemens publications – e.g. Catalogs – the
contents of the other documents have priority.
We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
Siemens AG 2016 All rights reserved
Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, systems, machines and networks.
tion In order to protect plants, systems, machines and networks against cyber
threats, it is necessary to implement – and continuously maintain – a holistic,
state-of-the-art industrial security concept. Siemens’ products and solutions only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.
Table of Contents
Warranty and liability ................................................................................................... 2
1 Task ..................................................................................................................... 4
1.1 Overview............................................................................................... 4
1.2 Problem description .............................................................................. 5
2 Solution............................................................................................................... 6
2.1 Overview............................................................................................... 6
2.2 Hardware and software components ................................................... 8
2.2.1 Validity .................................................................................................. 8
2.2.2 Components used ................................................................................ 8
3 Basics for System Diagnostics ...................................................................... 11
3.1 Diagnostics instructions ...................................................................... 11
3.2 Error OBs............................................................................................ 11
4 Mode of Operation ........................................................................................... 12
4.1 General overview ............................................................................... 12
4.2 Tag table “ConstDiagnostics” ............................................................. 14
4.3 Global data block “DiagnosticsData” [DB2080] .................................. 14
4.4 Global data block “HmiDB” [DB2081] ................................................. 16
4.5 Function block “DiagStartupPlc” [FB2002] ......................................... 19
4.6 Function block “DiagStartupIoSystem” [FB2001] ............................... 21
Siemens AG 2016 All rights reserved
1 Task
1.1 Overview
Introduction
In automation technology, diagnostics of devices, modules and networks is gaining
importance. Diagnostics with the user program enables determining failed
modules. In the user program, you can then program reactions to diagnostic
alarms, such as stopping your plant at certain diagnostic alarms.
Figure 1-1
Controller HMI
Diagnostic
information
PROFINET IE
PROFIBUS DP
Fault Fault
Slave 1 Slave n
2 Solution
2.1 Overview
Schematic layout
The figure below shows a schematic overview of the most important components of
the solution:
Figure 2-1
PROFINET IE
PROFIBUS DP
Fault
ET 200SP DP
Setup
The different distributed I/O devices are connected via PROFINET IO or
PROFIBUS DP using an S7-1500 controller. The devices detect the fault at their
modules and send diagnostic data to the allocated controller. The controller
evaluates this diagnostic information in the user program. The operator panel
displays the evaluated information graphically in a view for each IO system, or in a
device view respectively.
Note For a detailed description of the diagnostic instructions, please refer to the TIA
Portal online help or the
System Manual STEP 7 Professional V13 SP1
Assumed knowledge
Siemens AG 2016 All rights reserved
Note A list of the hardware and software products used can also be found in the
“98210758_User_defined_diagnostics_PRODUCTS_v21.zip” file in the archive.
Use the TIA Selection Tool for this.
Siemens AG 2016 All rights reserved
Hardware components
Table 2-1
Component Qty Article number Note
CPU 1516-3 PN/DP 1 6ES7516-3AN00-0AB0 Alternatively, any
other CPU S7-1500
can be used.
Memory Card, 1 6ES7954-8LE02-0AA0
12 Mbytes
Digital input, 1 6ES7521-1BL00-0AB0 Diagnostics can be
DI 32x24VDC HF configured
Front connector, screw- 2 6ES7592-1AM00-0XB0
type terminal, 40-pin
Digital output, 1 6ES7522-1BL00-0AB0 Diagnostics can be
DQ 32x24VDC/0.5A ST configured
Analog input, 1 6ES7531-7KF00-0AB0 Diagnostics can be
AI 8xU/I/RTD/TC ST configured
Front connectors, 1 6ES7592-1BM00-0XB0
Push-in technology, 40-pin
Software components
Table 2-2
Siemens AG 2016 All rights reserved
Note For more detailed information on the instructions and the error OB, please refer
to the TIA Portal online help.
4 Mode of Operation
4.1 General overview
Program overview
The graphic below shows the program structure of the entire STEP 7 project.
Figure 4-1
DiagStartup
GEO2LOG
Plc
Startup
DiagStartup
Module
IoSystem
States
Main
Diagnostics Diagnostics Diagnostics Device
Data States
Siemens AG 2016 All rights reserved
CopyTo
Get_Name
HmiDB
Diagnostic LOG2GEO
Diagnostic
error
interrupt Error
ShowDiag
Pull or plug PullOrPlug LED
of modules Modules
Rack or RackOr
station Station
failure Failure
Table 4-1
Symbolic name Description
DiagnosticsData The global data block includes the diagnostic information of
[DB2080] the controller and the IO systems.
HmiDB The data block serves as interface for the visualization.
[DB2081]
Startup The startup OB calls the function block “DiagStartupPlc”. For
[OB100] each IO system, the OB calls the function block
“DiagStartupIoSystem” and transfers the block to the hardware
ID of the IO system.
DiagStartupIoSystem Using the “GEO2LOG” instruction, the function block
[FB2001] determines the hardware ID of device and modules from the
slot. The “Get_Name” instruction reads the device name. The
instructions “ModuleStates” and “DeviceStates” read the
status of the modules and devices.
DiagStartupPlc Using the “GEO2LOG” instruction, the function block
[FB2002] determines the hardware ID of the modules from the slot. The
instructions “ModuleStates” and “DeviceStates” read the
status of the modules and devices.
MainDiagnostics The cycle OB calls the “Diagnostics” function block and
Siemens AG 2016 All rights reserved
The “DiagnosticsData” data block stores the hardware ID and the diagnostic
information of the controller and the IO systems.
For a better overview, the individual tags of the components were combined into
the following data types.
plc [typePlc]
The data type includes the information of controller and local modules.
Table 4-2
Tag name Data type Start Meaning
value
actualConfigured Int - Number of configured
CentralModules local modules
errorState Bool - Error state TRUE, in
the event of an error in
the plant.
slot Array - See slot [typeModul]
[1..MAX_MODULES_LOCAL]
of “typeModul”
slot [typeModul]
The data type includes the information of one module.
Table 4-3
Tag name Data type Start Meaning
value
Siemens AG 2016 All rights reserved
ioSystem [typeIoSystem]
The data type includes the information of an IO system.
Table 4-4
Tag name Data type Start Meaning
value
ioSystemId UINT - ID of IO system
ioSystemError Bool - Error state TRUE, in
the event of an error in
the IO system
firstDevice Int - Number of the first
device in the IO
system
lastDevice Int - Number of the last
device in the IO
system
actualConfigured Int - Number of configured
Devices devices
device Array - See
[1..MAX_DEVICES_SYSTEM] device [typeDevice]
of “typeDevice”
Note The array index of the “device” tag corresponds to the device number.
device [typeDevice]
The data type includes the information of a device.
Table 4-5
Tag name Data type Start Meaning
value
laddr HW_DEVICE - Hardware ID for the
module (system data
type)
name String[50] - Name of device
errorState USInt - Status of the device
Possible status (see
6.2 Representation of
the status of the
devices)
error Bool - Error state TRUE, in
the event of an error at
the device
nextDevice Int - Number of the next
device
actualConfigured Int - Number of configured
Siemens AG 2016 All rights reserved
Modules modules
slot Array - See slot [typeModul]
[1..MAX_MODULES_DEVICE]
of “typeModul”
Note The array index of the “slot” tag corresponds to the device number.
The data block stores the data for the visualization. For a better overview, the
individual tags of the components were combined into the following data types.
showPlc [typeShowPlc]
The data type includes the information of controller and local modules for the
visualization.
Table 4-6
Tag name Data type Start Meaning
value
diagnosisLoaded Bool - TRUE when the PLC
screen is displayed at
the HMI
errorState Bool - Error state TRUE
when an error has
occurred in the plant
slot Array - See
[1..MAX_MODULES_LOCAL] slot [typeShowModul]
of “typeShowModul”
slot [typeShowModul]
The data type includes the information of one module.
Table 4-7
Tag name Data type Start Meaning
Siemens AG 2016 All rights reserved
value
slotUsed Bool - TRUE, if a module is
configured at the slot
slotErrorState Bool - Error state TRUE in
the event of an error at
the module
showIoSystem [typeShowIoSystem]
The data type includes the information of an IO system.
Table 4-8
Tag name Data type Start Meaning
value
device Array - See
[1..MAX_DEVICES_SYSTEM] device
of “typeShowDevice” [typeShowDevice]
Note The array index of the “device” tag corresponds to the device number.
device [typeShowDevice]
The data type includes the information of a device.
Table 4-9
Tag name Data type Start Meaning
value
stationNumber UInt - Device number
name String[50] - Name of device
errorState USInt - Status of the device
Possible status (see
6.2 Representation of
the status of the
devices)
slot Array - See
[1..MAX_MODULES_DEVICE] slot [typeShowModul]
of “typeShowModul”
Note The array index of the “slot” tag corresponds to the device number.
showActIoSystem [typeShowActIoSystem]
Siemens AG 2016 All rights reserved
The data type contains tags for controlling the display as well as the information of
the selected IO system and the selected device.
Table 4-10
Tag name Data type Start Meaning
value
diagnosisLoaded Bool - TRUE when IO
system overview is
displayed at the HMI
actIoSystem Int 1 Index of the selected
IO system
actDeviceIndex Int - Index of the selected
device
copyModule Bool - Set at the HMI when
States the details view of a
device is selected
resetStates Bool - Set at the HMI using
the “Reset” button.
This resets the stored
error state.
device Array - See device
[1..MAX_DEVICES_SYSTEM] [typeShowDevice]
of “typeShowDevice”
actDevice “typeShowDevice” - See device
[typeShowDevice]
Interfaces
Figure 4-5 Call in “Startup [OB100]” for the controller
Table 4-11
Type Parameter Data type Description
Siemens AG 2016 All rights reserved
Function description
This block is used for automatically determining the hardware ID of the local
components with the “GEO2LOG” instruction by means of the slot information. A
tag of system data type “GEOADDR” is used for writing the slot information new
prior to each call of the instruction.
The hardware IDs are stored in the respective structure in global data block
“DiagnosticsData”.
Additionally, it performs the first diagnosis of the configured local components.
The following figure shows the principle program sequence of the function block.
Figure 4-6
Start/Stop
Set slot
information of
local module x
Siemens AG 2016 All rights reserved
GEO2LOG
Read HW ID
of local module
No
Last module
Yes
ModuleStates
Read state of
modules
Start/Stop
Interfaces
Figure 4-7 Call in “Startup [OB100]” for IO system 1 and IO system 2
Siemens AG 2016 All rights reserved
Table 4-12
Type Parameter Data type Description
Input ioSystemHwId HW_IOSYSTEM Hardware ID of the IO system
InOut ioSystem “typeIoSystem” Diagnostic data of the IO system
Output status Int Return value of the system function for
which the error has occurred
instructionError Int Indicates where an error has occurred:
1 = DeviceStates PN
2 = GetName PN
3 = ModuleStates PN
4 = DeviceStates DP
5 = GetName DP
6 = ModuleStates DP
errorIndex Int Device index for which an error occurs
Function description
This block is used for automatically determining the hardware ID of the
components of an IO system with the “GEO2LOG” instruction by means of the slot
information. A tag of system data type “GEOADDR” is used for writing the slot
information new prior to each call of the instruction.
The “GET_NAME” instruction additionally reads the names of the PROFIBUS DP
slaves and PROFINET IO devices.
Hardware IDs and names are stored in the respective structure in global data block
“DiagnosticsData”.
Additionally, it performs the first diagnosis of the configured components of an IO
system.
The following figure shows the principle program sequence of the function block.
Figure 4-8
Start/Stop
DeviceStates
Siemens AG 2016 All rights reserved
DeviceStates
Read state of GEO2LOG GEO2LOG
existing device Read HW ID HW ID
of device Read module
DeviceStates No
Read state of GET_NAME
faulty devices Read device Last module
name
Yes
LOG2GEO
Read number ModuleStates
Evaluate and save
of IO system Read state of
diagnosis modules
Evaluation
PROFIBUS DP or Determine index of first
Evaluate and save
PROFINET IO and last device and
number of devices state of modules
No No
Last device Last device
Yes Yes
Start/Stop
Interfaces
Figure 4-9 Call in “MainDiagnostics [OB123]”
Siemens AG 2016 All rights reserved
Table 4-13
Type Parameter Data type Description
Input firstCycleInit Bool TRUE in the first cycle
InOut plc “typePlc” Diagnostic data of the controller
and respective local modules
showPlc “typeShowPlc” Diagnostic data of the controller
and its local modules for
visualization
ioSystem Array Diagnostic data of the IO
[1..MAX_SYSTEM] systems
of “typeIoSystem”
showIoSystem Array Diagnostic data of the IO
[1..MAX_SYSTEM] systems for the visualization
of “typeShowIoSystem”
showActIoSystem “typeShowActIoSystem” Diagnostic data of the selected
IO system for visualization
Function description
In the first program cycle, the function block copies the diagnostic information
determined during startup into the “HmiDB”.
The function block uses the “LED” instruction to cyclically evaluate the status of the
error LED of the controller. In the event of a failure (LED status = 4), the error state
of the controller is set. It checks whether an error exists in an IO system.
The function block reacts to the entries made at the HMI. On demand, it resets the
stored error state and supplies the visualization with the requested data, such as:
Diagnostic information of controller and local modules
Diagnostic information of the IO system
Diagnostic information of the devices and their modules
The following figure shows the principle program sequence of the function block.
Figure 4-10
Start/Stop
cycle in HmiDB
Reset
saved
error state
CopyToHmiDB
Copy diagnostic
information
Start/Stop
Interfaces
Figure 4-11 Call in the program
Table 4-14
Type Parameter Data type Description
Input deviceIndex Int Index (device number) of a device.
(0 for PLC)
InOut plc “typePlc” Diagnostic data of the controller
and respective local modules
showPlc “typeShowPlc” Diagnostic data of the controller
and its local modules for
Siemens AG 2016 All rights reserved
visualization
ioSystem “typeIoSystem” Diagnostic data of the IO system
showIoSystem “typeShowIoSystem” Diagnostic data of the IO system
for visualization
Function description
The function copies the determined diagnostic information into the “HmiDB”.
The following figure shows the principle program sequence of the function block.
Figure 4-12
Start/Stop
PLC
PLC / Device?
Device
Copy diagnostic Copy diagnostic
information of the PLC information
devices in HmiDB in HmiDB
Start/Stop
Interfaces
Figure 4-13 Call in “Diagnostic error interrupt [OB82]”
Siemens AG 2016 All rights reserved
Table 4-15
Type Parameter Data type Description
Input ioState Word State of the hardware object
laddr HW_ANY Hardware ID of the hardware
object which has triggered the
diagnostic interrupt
channel UInt Channel number
multiError Bool TRUE, if there is more than one
error
InOut plc “typePlc” Diagnostic data of the controller
and respective local modules
showPlc “typeShowPlc” Diagnostic data of the controller
and its local modules for
visualization
ioSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeIoSystem”
showIoSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeShowIoSystem” for visualization
showActIoSystem “typeShowActIoSystem” Diagnostic data of the selected
IO system for visualization
Function description
The function determines the geographic address (slot information) of the failed
module from the hardware ID using the “LOG2GEO” instruction. The slot
information is stored in a local tag of system data type “GEOADDR”.
The function evaluates the state of the hardware object separately for controller
and IO system.
In the event of an error in the IO system, the index of the IO system is determined
using the IO system number. From the slot information of the local tag, the device
and slot index, needed for storing the diagnostic information at the appropriate
location, is determined.
The following figure shows the principle program sequence of the function block.
Figure 4-14
Start/Stop
LOG2GEO
Determine
slot information
Siemens AG 2016 All rights reserved
PLC
Area
PROFINET
PROFIBUS
Determine index of
IO system
IO_State IO_State
evaluate and save evaluate and save
CopyToHmiDB CopyToHmiDB
Copy diagnostic Copy diagnostic
information information
Start/Stop
Interfaces
Figure 4-15 Call in “Pull or plug of modules [OB83]”
Siemens AG 2016 All rights reserved
Table 4-16
Type Parameter Data type Description
Input laddr HW_IO Hardware ID of the respective
module
eventClass Byte Event
B#16#38: (sub-) module plugged
B#16#39: (sub-) module pulled
or not accessible
faultId Byte Error code
InOut plc “typePlc” Diagnostic data of the controller
and respective local modules
showPlc “typeShowPlc” Diagnostic data of the controller
and its local modules for
visualization
ioSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeIoSystem”
showIoSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeShowIoSystem” for visualization
showActIoSystem “typeShowActIoSystem” Diagnostic data of the selected
IO system for visualization
Function description
The function determines the geographic address (slot information) of the failed
module from the hardware ID using the “LOG2GEO” instruction. The slot
information is stored in a local tag of system data type “GEOADDR”.
The function evaluates the event and the error code separately for controller and
IO system.
In the event of an error in the IO system, the index of the IO system is determined
using the IO system number. From the slot information of the local tag, the device
and slot index, needed for storing the diagnostic information at the appropriate
location, is determined.
If a module is plugged, the function determines the current state of the modules of
the device using the “ModuleStates” instruction.
The following figure shows the principle program sequence of the function block.
Figure 4-16
Start/Stop
Siemens AG 2016 All rights reserved
LOG2GEO
Determine
slot information
PLC
Area
PROFINET
PROFIBUS
Determine index of
IO system
yes ModuleStates
Module plugged Determine state of
the modules
no
CopyToHmiDB CopyToHmiDB
Copy diagnostic Copy diagnostic
information information
Start/Stop
Interfaces
Figure 4-17 Call in “Rack or station failure [OB86]”
Siemens AG 2016 All rights reserved
Table 4-17
Type Parameter Data type Description
Input laddr HW_IO Hardware ID of the faulty
hardware object
eventClass Byte Event
B#16#38: going event
B#16#39: coming event
faultId Byte Error code
InOut plc “typePlc” Diagnostic data of the controller
and respective local modules
showPlc “typeShowPlc” Diagnostic data of the controller
and its local modules for
visualization
ioSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeIoSystem”
showIoSystem Array[1..MAX_SYSTEM] Diagnostic data of the IO system
of “typeShowIoSystem” for visualization
showActIoSystem “typeShowActIoSystem” Diagnostic data of the selected
IO system for visualization
Note Further events and error codes of error OB “Rack or station failure [OB86]”
(module rack error OB) are available in the TIA Portal online help.
Function description
The function determines the geographic address (slot information) of the failed
module from the hardware ID using the “LOG2GEO” instruction. The slot
information is stored in a local tag of system data type “GEOADDR”.
The function evaluates the event and the error code separately for controller and
IO system.
In the event of an error in the IO system, the index of the IO system is determined
using the IO system number. From the slot information of the local tag, the device
and slot index, needed for storing the diagnostic information at the appropriate
location, is determined.
When a device returns with failure, the block determines the current state of the
modules of the device using the “ModuleStates” instruction.
The following figure shows the principle program sequence of the function block.
Figure 4-18
Start/Stop
LOG2GEO
Siemens AG 2016 All rights reserved
Determine
slot information
PLC
Area
PROFINET
PROFIBUS
GEO2LOG
Determine index of
Determine
IO system hardware ID
ModuleStates
yes
Returned Determine state of
the modules
no
CopyToHmiDB CopyToHmiDB
Copy diagnostic Copy diagnostic
information information
Start/Stop
L+ M L+ M L+ M L+ M L+ M
SIMATIC HMI
SIMATIC DI DQ AI
TP1200
CPU 1516 32x24VDC 32x24VDC 8xU/I/RTD/TC
Comfort
PN PN DP 1 19 PN PN
Simulation
Drahtbruch
PROFINET / IE
L+ M L+ M L+ M L+ M
Siemens AG 2016 All rights reserved
SIMATIC DI DQ AI
IM 155-5 PN 32x24VDC 32x24VDC 8xU/I/RTD/TC
PN PN
L+ M L+ M L+ M L+ M L N
SIMATIC DI DQ AQ SINAMIC
IM 155-6 PN 8x24VDC 8x24VDC 4xU/I G120
PN PN PN PN
L+ M L+ M L+ M L+ M L+ M
SIMATIC DI AI SIMATIC DI
IM 155-6 DP 8x24VDC 4xRTD/TC IM 155-6 PN 16x24VDC
DP PN PN
PROFIBUS DP
Table 5-1
Component Device IP PROFIBUS Device name
number Address address
SIMATIC CPU 1516 0 192.168.0.1 2 PLC_1
SIMATIC IM 155-6 PN 1 192.168.0.2 ET200SP_1
SIMATIC IM 155-5 PN 2 192.168.0.3 ET200MP_2
SIMATIC IM 155-6 PN 10 192.168.0.10 ET200SP_10
SINAMICS G120 30 192.168.0.30 Drive_1
SIMATIC HMI TP1200 - 192.168.0.4 TP1200
SIMATIC IM 155-6 DP - - 8 Slave_8
Note At this point, it is assumed that the necessary software has been installed on
your computer and that you are familiar with the software.
For each module of your project you can enable the module-specific diagnostic
settings separately.
The following diagnostic settings are possible, for example:
No supply voltage L+
Wire break
Short circuit to ground
etc.
In order to copy the objects of the application, you either open this application
parallel to your project, or you open this application as a reference project for your
project.
Table 5-4
No. Action
1. In “PLC_1 > PLC tags” you copy the “Diagnostics” folder into your project.
2. In “PLC_1 > PLC data types” you copy the “Diagnostics” folder into your project.
3. In “PLC_1 > Program blocks” you copy the “Diagnostics” folder into your project.
4. If your project already contains error OBs, copy the networks of the error OBs of
the application into your respective error OBs. Please ensure that the position of
the inserted code may affect the program sequence.
Then you delete the error OBs OB82, OB83 and OB86 of the application.
No. Action
5. Adjusting constants to your project
Open the user constants in “PLC tags > Diagnostics > ConstDiagnostics”
Using the user constants you adjust the diagnostics application to your project. To
do so, change the following constants:
1. Optional: if you wish to save storage space, adjust the
MAX_DEVICES_SYSTEM constant to the highest device number in your
project. In der visualization, a maximum of 256 devices is displayed.
2. Adjust the MAX_SYSTEM constant to the number of IO systems in your
project.
3. Create new constants for further IO systems.
For example, “IO_SYSTEM3 Int 3 ” etc.
These constants are used in the next step as index for the IO system.
1
Siemens AG 2016 All rights reserved
No. Action
6. Adjusting “Startup [OB100]” to the project
1. Open startup OB “Startup [OB100]”
2. Open the system constants in “PLC tags > Default tag table”
3. Divide the editing section vertically
4. Assign the hardware ID of the IO system
(data type: Hw_IoSystem) from the system constants to the “ioSystemHwId”
input of function block “DiagStartupIoSystem”.
5. Assign the diagnostic structure of an IO system of data block
“DiagnosticsData” to the “ioSystem” parameter.
Please note that each IO system receives its own index
6. If necessary, add further instances of function block “DiagStartupIoSystem”
into startup OB “Startup [OB100]” and repeat steps 4 and 5.
For each IO system, an instance of function block “DiagStartupIoSystem”
must be available.
2 1
3
Siemens AG 2016 All rights reserved
3. In “TP1200 > Scripts > VB scripts” you copy the “Diagnostic” folder into your HMI
project.
4. In “TP1200 > Screen management > Pop-up screens” you copy the
“Pop-up_OverviewModules” screen into your HMI project.
5. In “TP1200 >Screens > 001_Application” you copy the screens
“Topic_001.0_PLC”, “Topic_002.0_IO_System” and “Topic_003.0_Messages” into
your HMI project.
Siemens AG 2016 All rights reserved
Note You can also copy the entire HMI from the example and integrate the HMI
application into it.
Note The visualization of the application shows the devices with device number 1 to
256. If your device numbers are within this range, you can skip this chapter.
Note If you wish to display more than 256 devices in your visualization, the number of
devices must be a multiple of 64, since 64 devices are displayed in the
visualization per page.
2. The structure of the tags in the HMI tag table "TagTable_Diagnostic" automatically
adapts to the structure of the plc variables.
The lowest array index in the HMI is 0, as opposed to 1 in the PLC program.
Requirement: the tags already exist in the controller.
This only requires changing the PLC constant “MAX_DEVICES_SYSTEM” to
“320” (see Integrating the PLC point 5).
No. Action
4. Open HMI tag table “TagTable_Multiplex”.
Expand multiplex tags “Field1” to “Field64” using the respective tags at index 4.
Note If you wish to display fewer devices, you can reduce the number of devices in the
same way as well.
Close pop-up
Table 6-1
Status Representation Meaning
1 Device OK
2 Device faulty
Table 6-2
No. Action Notes
1. Drag module DQ16 to
ET200SP_1 slot 2.
2. 1. Open the “IO Systems” 1
screen at the operator 3
panel.
2. Select “IO System 1”.
The screen indicates
the failure at the
device with device
number 1.
3. For detailed
information on the
failure, please click on
the button of device 1.
Table 6-3
No. Action Notes
1. Drag module DQ16 to
ET200SP_1 slot 2.
2. The failure is stored in
2 1
global data block
“DiagnosticsData”. The
data block can be
interpreted in the following
way: 3
Note For further failures, you can also proceed as described above.
History
Siemens AG 2016 All rights reserved
8
Table 8-1
Version Date Modifications
V1.0 09/2014 First version
V2.0 04/2015 New version with evaluation of the errors in the error OBs
V2.1 04/2016 New version with SINAMICS G120 and structured HMI tags
V2.2 07/2016 New version: Change of the error evaluation
V2.3 10/2016 New version: Small error correction