Automation and Drives
PROFIBUS DP diagnostics
PROFIBUS DP
PROFIBUS diagnostics (PC RunTime)
SITRAIN IK-PBSYS / PROFIBUS Di Diagnostics
Page 1
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Co n t en t s
Pag e
PROFIBUS PROFIBUS DP diagnostic diagnostics s .......... ................ ............ ........... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... .......... .......... ........... ............ ............ .......... ......
2
Fault analysis analysis options options with STEP STEP7 7
3
.......... ................ ............ ........... .......... .......... .......... ........... ........... .......... ........... ........... .......... .......... .......... ........... ........... .......... .....
Reacti Reactions ons of bus fault fault LEDs LEDs (DP maste master) r)
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ..... ..
4
Reacti Reactions ons of bus fault fault LEDs LEDs (DP slave) slave) ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
5
Fault analysis analysis with OB86 .......... ................ ........... .......... ........... ........... ........... ........... ........... ........... .......... ........... ........... ........... ............ ........... .......... ........... ........... .......... ........ ...
6
OB86 OB86 : Evalu Evaluati ating ng the cause cause of the call and respon respondin ding g ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... .....
7
Exercise 1: 1: Visuali Visualize ze a slave slave failure failure (OB 86) 86)
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ..... ..
8
Exercise 2: 2: Determ Determine ine the slave downtim downtime e ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ..... .. Exercise 3: 3: "Diagn "Diagnose ose hardware hardware online" online" .......... ............... ........... ........... .......... ........... ........... .......... ........... ........... .......... ........... ............ ........... .......... .......... .......
9 10
Customer Customer support (download (download area) ........... ................ ........... ........... .......... .......... .......... ........... ........... .......... ........... ........... .......... .......... .......... ........... ............ ......... ...
11
Exercise 4: 4: Integra Integrate te WinCC WinCC flexible flexible "PC RT" ........... ................. ........... .......... ........... ........... .......... .......... ........... ........... ........... ............ ........... .......... .......
12
Exercise 5: 5: Assign Assign the Runtime Runtime interface interface parameters parameters
........... ................ .......... .......... .......... ........... ............ ............ ............ ........... .......... ......... ....
13
Exercise 6: 6: Assign Assign the connec connectio tion n paramete parameters rs ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ... Exercise 7: 7: Integrate Integrate FB125 FB125 into the S7 program program ........... ................. ........... ........... ........... .......... .......... .......... .......... ........... ............ ........... .......... .......
14 15
Exercise 8: 8: Diagnostic Diagnostic test WinCC flexible flexible RT ........... ................ .......... ........... .......... .......... ........... .......... ........... ............ ........... .......... ........... ........... .......
16
Exercise 9: 9: Failure Failure history history of DP slaves slaves
........... ................. ........... .......... ........... ........... .......... .......... ........... ........... ........... ........... ........... ........... ........... ......... ...
17
"Report "Report system system error" error" function function
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
18
Operating Operating principle: principle: Alarm_S/SQ Alarm_S/SQ
........... ................ .......... .......... .......... ........... ........... .......... ........... ............ ............ ............ ............ ........... .......... .......... .......... ......... ....
19
Configure Configure the "Report "Report system error" function function (1)
.......... ................ ........... .......... .......... .......... ........... ........... .......... ........... ........... .......... .......... ......... ....
20
Configure Configure the "Report "Report system error" function function (2)
.......... ................ ........... .......... .......... .......... ........... ........... .......... ........... ........... .......... .......... ......... ....
21
OB configur configurati ation on + CPU respons response e in ST STOP OP state
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
22
........... ................ .......... ........... ........... ........... ........... ........... ............ ........... .......... ........... .......... .......... ............ ........... .......... .......... ........... ........ ..
23
Diagnostic Diagnostic support + User block .......... ............... ........... ............ ........... .......... .......... .......... .......... ........... ........... .......... ........... ........... .......... ........... ........... .......... .......... .....
24
Result Result check check using using "CPU "CPU messag messages" es" .......... ................ ........... .......... .......... .......... ........... ........... .......... .......... .......... ........... ............ .......... .......... ........... .......... ....... ..
25
Messages Messages + User block tab
SITRAIN trainin training g for Automation and Industrial Solutions
Page 1
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
PROFIBUS DP diagnostics
PROFIBUS DP
PROFIBUS diagnostics (PC RunTime)
SITRAIN IK-PBSYS / PROFIBUS Di Diagnostics
Page 2
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Co n t en t s
Pag e
Exercise 10: 10: Configure Configure "Report "Report system error" .......... ................ ............ ............ ............ ........... .......... .......... .......... ........... ............ ............ ............ .......... .... Enable Enable Alarm_ Alarm_S S messa messagin ging g (Win (WinCC CC flexib flexible) le) ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... .....
26 27
Exercise 11: 11: Display Display Alarm_S Alarm_S messages messages ........... ................ ........... ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... .......... .......... ........ ... Deactivate Deactivate and and activate activate slaves slaves with with SFC12 SFC12 ........... ................ ........... ............ ........... .......... .......... .......... ........... ........... .......... .......... ........... ............ ........... .......
28 29
Sample Sample program for slave deactivation deactivation
........... ................ ........... ........... .......... ........... ........... .......... ........... ........... ........... ........... ........... ............ ........... .......... .....
30
Exercise 12: 12: Activate Activate and deactiva deactivate te slaves slaves ........... ................ .......... ........... ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ....... .. If you you want want to know more ........... ................ .......... .......... .......... ........... ............ ........... .......... .......... ........... ........... ........... ............ ............ ............ ............ ........... .......... .......... .....
31 32
Diagnosis Diagnosis of a specific specific DP slave with SFC13
.......... ................ ............ ............ ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... ....... ..
33
........... ................ .......... ........... ........... .......... ........... ............ ............ ........... .......... .......... ........... ........... .......... .......... .......
34
S7 program with an SFC13 SFC13 call call in OB1
Parameters Parameters of the SFC13 SFC13 (standard (standard diagnostic diagnostics) s)
.......... ............... .......... ........... ............ ........... .......... .......... .......... ........... ........... .......... .......... ......... ....
35
............ ................. .......... .......... .......... ........... ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ........... ............ ........... ........ ...
36
Exercise 13: 13: Slave analysis analysis with SFC13 ........... ................. ........... ........... ........... ........... ........... ........... ........... .......... ........... ............ ........... .......... .......... ........ ...
37
SFC11: SFC11: "Freez "Freezing ing"" of DP input input signals signals
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
38
Group assignment assignment for SYNC SYNC and FREEZE FREEZE ........... ................ ........... ............ .......... .......... ........... .......... .......... .......... ........... ............ ........... .......... .......... ....... ..
39
S7 program program for freezing freezing DP input signals signals
........... ................ .......... .......... .......... ........... ............ ........... ........... ............ ............ ............ ........... .......... .......... ....... ..
40
............ ................. .......... .......... .......... ........... ........... .......... .......... ........... ............ ............ ........... .......... ........... ........... .......
41
Diagnostics Diagnostics data format format
Evaluation Evaluation with active active FREEZE FREEZE mode
Synchr Synchroni onizat zation ion,, i.e. i.e. output output and and freezi freezing ng of digit digital al outpu outputs ts on DP slav slaves es S7 program program for synchronizi synchronizing ng DP output signals signals
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
42
........... ................ .......... .......... ........... ........... .......... .......... ........... ............ ............ ........... ........... ........
43
Copying Copying the original original outputs outputs to the ET200S ET200S (SYNC group) group)
SITRAIN trainin training g for Automation and Industrial Solutions
Page 2
........... ................. ........... .......... .......... .......... .......... .......... .......... ........... .......... ....
44
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
PROFIBUS DP diagnostics
PROFIBUS DP
PROFIBUS diagnostics (PC RunTime)
SITRAIN IK-PBSYS / PROFIBUS Di Diagnostics
Page 2
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Co n t en t s
Pag e
Exercise 10: 10: Configure Configure "Report "Report system error" .......... ................ ............ ............ ............ ........... .......... .......... .......... ........... ............ ............ ............ .......... .... Enable Enable Alarm_ Alarm_S S messa messagin ging g (Win (WinCC CC flexib flexible) le) ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... .....
26 27
Exercise 11: 11: Display Display Alarm_S Alarm_S messages messages ........... ................ ........... ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... .......... .......... ........ ... Deactivate Deactivate and and activate activate slaves slaves with with SFC12 SFC12 ........... ................ ........... ............ ........... .......... .......... .......... ........... ........... .......... .......... ........... ............ ........... .......
28 29
Sample Sample program for slave deactivation deactivation
........... ................ ........... ........... .......... ........... ........... .......... ........... ........... ........... ........... ........... ............ ........... .......... .....
30
Exercise 12: 12: Activate Activate and deactiva deactivate te slaves slaves ........... ................ .......... ........... ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ....... .. If you you want want to know more ........... ................ .......... .......... .......... ........... ............ ........... .......... .......... ........... ........... ........... ............ ............ ............ ............ ........... .......... .......... .....
31 32
Diagnosis Diagnosis of a specific specific DP slave with SFC13
.......... ................ ............ ............ ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... ....... ..
33
........... ................ .......... ........... ........... .......... ........... ............ ............ ........... .......... .......... ........... ........... .......... .......... .......
34
S7 program with an SFC13 SFC13 call call in OB1
Parameters Parameters of the SFC13 SFC13 (standard (standard diagnostic diagnostics) s)
.......... ............... .......... ........... ............ ........... .......... .......... .......... ........... ........... .......... .......... ......... ....
35
............ ................. .......... .......... .......... ........... ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ........... ............ ........... ........ ...
36
Exercise 13: 13: Slave analysis analysis with SFC13 ........... ................. ........... ........... ........... ........... ........... ........... ........... .......... ........... ............ ........... .......... .......... ........ ...
37
SFC11: SFC11: "Freez "Freezing ing"" of DP input input signals signals
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
38
Group assignment assignment for SYNC SYNC and FREEZE FREEZE ........... ................ ........... ............ .......... .......... ........... .......... .......... .......... ........... ............ ........... .......... .......... ....... ..
39
S7 program program for freezing freezing DP input signals signals
........... ................ .......... .......... .......... ........... ............ ........... ........... ............ ............ ............ ........... .......... .......... ....... ..
40
............ ................. .......... .......... .......... ........... ........... .......... .......... ........... ............ ............ ........... .......... ........... ........... .......
41
Diagnostics Diagnostics data format format
Evaluation Evaluation with active active FREEZE FREEZE mode
Synchr Synchroni onizat zation ion,, i.e. i.e. output output and and freezi freezing ng of digit digital al outpu outputs ts on DP slav slaves es S7 program program for synchronizi synchronizing ng DP output signals signals
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
42
........... ................ .......... .......... ........... ........... .......... .......... ........... ............ ............ ........... ........... ........
43
Copying Copying the original original outputs outputs to the ET200S ET200S (SYNC group) group)
SITRAIN trainin training g for Automation and Industrial Solutions
Page 2
........... ................. ........... .......... .......... .......... .......... .......... .......... ........... .......... ....
44
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Fault analysis options with STEP7
Diagnostic features
Visual inspection of the LEDs
LEDs LEDs on master master
STEP 7 softw are
LEDs LEDs on slave slave
Read Read ou t diagnostics buffer
SITRAIN IK-PBSYS / PROFIBUS Di Diagnostics
LEDs
User program
Diagnose hardware
Page 3
Start Start inf . error OB
Call SFC 13
Diagnosis FB 125
03/2007 © Siemens AG 2007 - Subject to change without prior notice
There are LEDs on the slaves for troubleshooting which which either light up or flash in the event of a fault. The meaning meaning of the individual LEDs LEDs is explained in the manual for the corresponding slave. On the CPU with an integral DP interface, only bus faults are signaled with LED "BUSF". BUSF".
STEP STEP 7 sof tware
In the event of a fault, read out the diagnostic buffer or call up the tool "Diagnose hardware". hardware ".
Program
If a slave fails and restarts, the error OB 86 is output. The start information then contains the diagnostic address of the faulty slave. By calling the system function SFC 13 you can view additional diagnostic data for the slave as defined by standard EN 50 170. Detailed information down to the individual channel is supplied by the standard block FB 125. 125. This is offered on the Internet as a diagnostic package together with standard HMI screens.
SITRAIN trainin training g for Automation and Industrial Solutions
Page 3
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Reactions Reactions of bus bus fault LEDs (DP master) master) Possible faults • Scenar Scenario io 1: • Scen Scenar ario io 2: • Scenario Scenario 3: • Scen Scenar ario io 4:
• Scenario Scenario 5:
Bus fault fault (hardw (hardware are fault) fault) DP inte interf rfac ace e faul faultt Different Different transmissi transmission on rates in multiple multiple DP master master mode If the the DP DP sla slave ve / mas master ter inte interfa rface ce is acti active ve:: Short-circuit on the bus. With passive passive DP slave interface: interface: Transmiss Transmission ion rate search, search, i.e. there are currently no other active nodes on the bus Bus fault LEDs (a master, for example)
Response Response o f t he CPU, CPU, possib le remedies Call of OB 86 (when CPU is in RUN mode). CPU switches to STOP if OB 86 is not loaded. Possible remedies • Check Check the the bus cabl cable e for short short circ circuit uit or brea breaks. ks. • Evaluate Evaluate the diagnostics. diagnostics. Create a new new configu configuration ration or edit the existing one.
SITRAIN IK-PBSYS / PROFIBUS Di Diagnostics
Page 4
03/2007 © Siemens AG 2007 - Subject to change without prior notice
BUSF LED flashes on t he DP master CPU Faults
- Scenario Scenario 1: Failure Failure of a connected connected station station - Scenario Scenario 2: At least one one of the assigned assigned slaves slaves cannot be accessed accessed - Scenar Scenario io 3: Config Configuri uring ng error error
Response
Call OB 86 (when CPU is in RUN state). CPU switches to STOP if OB 86 is not loaded.
Remedy - Verify Verify that the bus bus cable is connec connected ted to the CPU CPU and that the the bus is not interrupted. - Wait until the CPU has booted. booted. If the LED does not stop flashing, check the DP slaves or evaluate the diagnostic data for the DP slaves.
SITRAIN trainin training g for Automation and Industrial Solutions
Page 4
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Reactions of bus fault LEDs (DP slave) LED states Meaning Remedy
SF = off + BF = off + ON = off No power is connected to the inter face module or interface module hardware is defective. Switch on the 24 V DC supply voltage on the interface module. Group fault (SF)
LED states Meaning
SF = on + BF = on + ON = on Power is connected to the interface module.
LED states Meaning
SF flashing + BF flashing + ON = on Interface is not configured or is incorrectly configured No data are being exchanged between the DP master and the interface module. Causes: PROFIBUS address is wrong, configuration error or parameter error Check the interface module. Check the configuration and parameters. Check the PROFIBUS address.
Remedy
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 5
Bus fault LEDs
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Other LED status combi nations: Status 1
SF flashing + BF on + ON on
means the following:
- Baud rate search, illegal PROFIBUS address or bottom DIL-Switch (PROFIBUS address) is not set to OFF. - A response monitoring timeout has occurred or - Bus communication to the interface module via PROFIBUS DP has been interrupted Remedy:
Set a valid PROFIBUS address (1 to 125) on the interface module, or check the bus setup: - Verify that the bus connector is properly inserted. - Check for breaks in the bus cable to the DP master. - Switch the 24 V DC supply voltage to the interface module off and on again.
Status 2
SF on + BF flashing + ON on means the following: - Programmed ET 200S configuration does not match the actual ET 200S configuration or I/O module is faulted o r the interface module is defective.
Remedy
- Check the setup of the ET 200S: Check whether a module is missing or defective or whether an unconfigured module is inserted. - Check the configuration and eliminate the parameterization error. - Replace the interface module, or get in touch with your Siemens contact person.
Status 3
SF off + BF off + ON flashing means the following: - Data are being exchanged between the DP master and the ET 200S. - The target and actual configurations of the ET 200S are identical. - The slave is working correctly.
SITRAIN training for Automation and Industrial Solutions
Page 5
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Fault analysis with OB86
Event class
Incoming fault
Outgoing fault
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 6
03/2007 © Siemens AG 2007 - Subject to change without prior notice
General
The operating system of the CPU calls OB86 if a PROFIBUS DP error is identified by the system. OB86 is called by the system when the DP error appears (incoming event) and disappears (outgoing event). If the OB86 has not been programmed and such a fault occurs, the CPU switches to STOP mode.
Note
Evaluation of OB86 in the program: Evaluate reason for call: The local variable #OB86_EV_CLASS contains the "direction" of the cause of the OB86 call with the event c lasses and identifiers: -
SITRAIN training for Automation and Industrial Solutions
B#16#38: B#16#39:
Outgoing event Incoming event
Page 6
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
OB86 : Evaluating the cause of the call and responding
Fault class (fault ID)
B#16#C3 : Distribut ed I/O: Failure o f a DP master system B#16#C4 : Failure of a DP station B#16#C5: Fault in a DP station
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Note
Page 7
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Evaluation of OB86 in the program: Evaluate reason for call: The local variable #OB86_FLT_ID contains the temporary variable "Fault identification" of the OB86 call with identifiers: -
SITRAIN training for Automation and Industrial Solutions
B#16#C3: Distributed I/O devices: Failure of a DP master system B#16#C4: Failure of a DP station B#16#C5: DP station fault
Page 7
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 1 : Visualize a slave failure (OB 86)
Slave failure
Alarm view
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 8
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
In the event of a slave failure, the CPU must not switch to STOP. The slave failure must be displayed with the DP address of the failed slave in the previously configured "Message" screen on the touch panel.
Procedure
1.Insert the error organization block OB 86 into your S7 program. 2.Change the declaration section of the block as illustrated in the above figure:
3.
•
Change name of variable "OB86_RACKS_FLTD" to "OB86_Z23" (not an essential measure, but done here simply to follow the procedure described in the STEP7 online help)
•
Change data type from "Array[0..31] Of Bool" to "DWORD" (essential because variables of data type "Array" cannot be scanned with the load instruction)
To make sure that the right messages are displayed on the touch panel, program OB 86 in such a way that … •
…flag "M_SlaveFailure" (M 86.0) is set when the slave fails and reset when the slave recovers ( evaluation of variable "OB86_EV_CLASS")
• the DP address of the failed slave is stored in MB87 "MB_SlaveAddress" Solution tip: (see also OB 86 in online help)
SITRAIN training for Automation and Industrial Solutions
Page 8
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 2 : Determine the slave downtime
Slave failure
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 9
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
The purpose of this exercise is to determine the DP slave downtime and store it in flag double word "MD_Slave_Downtime" (MD 88).
Procedure
Extend the OB 86 program in such a way that the above functions are implemented. Solution tip: To calculate the slave downtime, use block FC8 "DT_TOD" from the standard library IEC Funktion Blocks. Using a time stamp of data type "DT" (Date and Time), this block extracts time information of data type "TOD" (Time of Day). The time of day is stored as a time period (0:00 hours to the specified time) in milliseconds (whole numbers) in a var iable of data type "TOD" which means that it can be used for other calculations like a "DINT" variable.
SITRAIN training for Automation and Industrial Solutions
Page 9
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 3 : "Diagnose hardware online"
Module status (diagnostic buffer)
Online diagnosis of hardware
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 10
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to analyze DP slave failures using the "Diagnose hardware" online function.
Procedure
1.Remove the module from slot 5 on the ET 200S. 2.In the menu Options
Customize View,
select the quick view.
3.Now select menu commands PLC Diagnosis/Settings Diagnose hardware.
4.Select the line of the failed DP slave and then click on the module status button. 5.Analyze the messages in the Module status DP slave window: Messages
.......................................................................................................................... .......................................................................................................................... .......................................................................................................................... .......................................................................................................................... 6.Now re-insert the module in the ET 200S.
SITRAIN training for Automation and Industrial Solutions
Page 10
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Customer support (download area)
Download ID
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 11
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
FB125 is provided for the diagnostic evaluation of a distributed configuration with PROFIBUS DP and SIMATIC S7 in cases where detailed information about faults or bus node failures is required in addition to the general diagnosis.
Download
S7 diagnostic block FB125 V4.9 and WinCC flexible d iagnostic displays as an archived STEP 7 project for WinCC flexible 2005 and description of the DP diagnostic blocks for SIMATIC S7: -
Dp_op_21 zip (51.772 KB)
Description of DP diagnostic blocks for SIMATIC S7 and diagnostic displays for ProTool and WinCC flexible: -
SITRAIN training for Automation and Industrial Solutions
Onlinehilfe_FB125.EXE (2.258KB)
Page 11
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 4 : Integrate WinCC flexible "PC RT"
Copy S7 blocks
Copy WinCC flexible PC Runtime
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 12
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to copy the WinCC flexible station "PC RT" and the relevant S7 blocks from the PROFIBUS diagnostic package supplied by Siemens customer support into your project.
Procedure
1.Delete - if stored - the project "DP_OP_21_WinCC_flexible“ 2.Extract project "DP_OP_21.zip" from directory \:S7_Courses\Archives 3.Copy the station "PC RT" from project "DP_OP_21_WinCC_flexible" into your own project. 4.Copy all the blocks (except the OBs and the system data) from the S7 block container in project "DP_OP_21_WinCC_flexible" to your own project
SITRAIN training for Automation and Industrial Solutions
Page 12
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 5 : Assign the Runtime interface parameters
CP 5611 (SW V6.0 SP5)
PROFIBUS address Runtime interface
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 13
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
In order to ensure that the S7 program symbols are available in the WinCC flexible project, the Runtime interface must be configured and parameterized with the "HW Config" tool.
Procedure
1.Open the hardware configuration for the WinCC flexible station "RT PC" 2.Configure and parameterize the CP5611 module as shown above (set PROFIBUS address to 0 so that the PC configuration does not alter the default settings for the PC interface) 3.Save and compile the HW configuration of the PC station 4.Download the configuration to your local PC system (PC Runtime)
SITRAIN training for Automation and Industrial Solutions
Page 13
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 6 : Assign the connection parameters
Connection parameters
Connections
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 14
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Set up a connection so that the panel Runtime application can communicate with your trainer PLC.
Procedure
1.Launch WinCC flexible by opening the WinCC flexible station in the SIMATIC Manager (see figure on left) and double click on "Connections" in this screen 2.Check whether your S7 station has been set up as a connection partner and whether the copy operation might delete o r deactivate (Exercise 4) existing connections. 3.Connect the WinCC flexible variables to the PLC variables by selecting Options Re-connect… select dialog options as illustrated below ok (select all variables in the variable editor)
4.Generate the whole project again by selecting Project Generator Regenerate all
SITRAIN training for Automation and Industrial Solutions
Page 14
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 7 : Integrate FB125 into the S7 program OB 1, OB 82, OB 86
Call in all OB runtime classes: OB1,OB82, OB86
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Task description
Page 15
03/2007 © Siemens AG 2007 - Subject to change without prior notice
To ensure that the diagnostic data for a failed slave are stored in the instance data block DB 125, FB 125 must be called in organization blocks OB 1, OB 82 and OB 86 with instance data block DB 125 in each case. In this case, it is not necessary to parameterize or transfer actual operands to the formal operands of FB 125.
Procedure
1.Program the call of FB 125 with instance DB 125 in OB 1 2.Program the call of FB 125 with instance DB 125 in OB 82 3.Program the call of FB 125 with instance DB 125 in OB 86 4.Download FB 125, DB 125 and the modified OBs to the CPU
Notes
The sequence and the contents of the 20-byte long temporary local data of the organization blocks OB1, OB82 and OB86 must not be changed, but can be extended at any time. The following SFCs are used internally in the FB125: SFC13 and SFC51 with SZL 0C91 (with an internal DP interface to the master CPU) or SZL 4C91 (with an external DP interface to the CP/IM). It is not permissible to call SFC13 and/or SFC51 with SZL OC91/4C91 in the OB1 in addition to the FB125 call for a faulty slave. Evaluation of the information in the b lock output parameters is meaningful only in the cyclic program section (OB1). If the FB125 block is processed correctly, the BIE bit is set to "1". The BIE bit is reset if FB125 has been incorrectly processed. When the CPU is booting (first OB1 cycle) and during a RESET, the whole DP system is detected in the FB125 by an initialization routine. The diagnosis process is interrupt-driven, i.e. if a diagnostic event or station failure occurs, the evaluations are performed in the corresponding error OBs. No call condition must therefore be generated in the block (see above).
SITRAIN training for Automation and Industrial Solutions
Page 15
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 8 : Diagnostic test WinCC flexible RT
Next fault
"Manual" single diagnosis
Next slave Transfer to master system
Detailed diagnosis
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
General diagnosis
Exit diagnostics Page 16
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to perform a function test on the PROFIBUS diagnostic package.
Procedure
1.Open the WinCC flexible station "RT PC" 2.Generate and start the Runtime application of WinCC flexible 3.Provoke an ET 200S failure 4.Check the data shown in displays "General diagnosis" and "Detailed diagnosis"
SITRAIN training for Automation and Industrial Solutions
Page 16
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 9 : Failure history of DP slaves
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
General
Page 17
03/2007 © Siemens AG 2007 - Subject to change without prior notice
You want to record the individual slave failures statistically. You can use the supplied source for this purpose from which theFB126 block is generated. It is called in OB 86 and generates a history of slave failures in a ring buffer. The structure of the instance DB for FB126 is as follows: Bytes 0..3
Reserved
Bytes 4..129
Statistics for each slave (each slave has a reserved byte which is incremented by 1 if the slave fails.)
Bytes 130..3201 Ring buffer with:ID / slave number incoming / outgoing result / time stamp FB126 does not need any transfer parameters. The number of failures can be read directly in the instance DB for each slave. Procedure
1.Copy file OB86Diag.exe to a separate directory and launch the application with a double click. 2.Open the SIMATIC Manager and select the source container in your project. 3.Import the source file with the menu item "Insert External Source". 4.Open the inserted source with a double click and then compile. You will now find the generated blocks in the block container of your project.
Note
Article ID: Date:
SITRAIN training for Automation and Industrial Solutions
2289283
Unchanged since 28.04.2000
Page 17
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
"Report system error" function Al l t he b lo ck s r equ ir ed ar e aut om ati cal ly gen erat ed The PLC automatically sig nals system erro rs to the HMI SIMATIC HMI PG/PC
STEP 7 HMI
S7 data PLC
HMI data
Result is automatically transferred to the HMI as a message
Au to mat ic message display
PROFIBUS DP Slave Slave diagnostics
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Definition
Page 18
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The STEP 7 "Report system error" function pro vides a convenient way to display diagnostic information provided by the component in the form of messages. STEP 7 automatically generates the necessary blocks and message texts. The user must simply download the generated blocks into the CPU and transfer the texts to the connected HMI devices.
Settings
In the hardware configuration, select the CPU for which you wish to configure system error reporting. Then select menu commandsOptions Report system error and assign parameters on the following tab sheets.
SITRAIN training for Automation and Industrial Solutions
Page 18
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Operating principle: Alarm_S/SQ
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Alarm_S/SQ
Page 19
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The Alarm_S process is organized according to message numbers which are automatically assigned when the function is configured in STEP 7. These numbers are used to uniquely assign alarm messages. When a fault occurs, the HMI system is notified via the message number with assigned message text. When a fault occurs, the CPU stores the time of day plus any relevant process parameters in addition to the message status (incoming, outgoing, acknowledged). This information makes it easier to diagnose the fault cause. The message information is stored in the PLC and not discarded immediately the messages are sent. This means that individual network components (e.g. HMI systems) can log on later and receive updated information.
Advantages
ALARM_S offers the following advantages over the message bit procedure: • ALARM_S is an active messaging procedure. If a message is generated, the CPU actively notifies all logged-on network nodes (polling is not used). • The process values are always identical to the values stored at the instant the message is generated. This advantage is not guaranteed with the message bit procedure. • The time stamp exactly specifies the time at which an event occurred, even if the HMI system was not connected until later.
Message typ es
Two types of ALARM_S message can be configured in STEP 7. They differ in terms of their acknowledgement requirements: • Messages which require an acknowledgement. These messages are always treated like fault messages. • Messages which do not require an acknowledgement. These messages can be either fault or operational messages.
SITRAIN training for Automation and Industrial Solutions
Page 19
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Configure the "Report system error" function (1) Signaling of system errors
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 20
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Configuration window tab for " Report system error" General
Use the "General" tab (Report system error) to specify which function block is to be used as a diagnostic block. In addition, you can specify the response of "Report system error" during generation.
OB configuration
Use the "OB configuration" tab (Report system error) to specify which OBs are to be supported, which OBs are to be created and in which OBs the "Report system error" function is to be called.
CPU in STOP mode Use the "CPU in STOP mode" tab (Report system error) to specify which error classes cause the CPU to switch to STOP mode. Messages
Use the "Messages" tab (Report system error) to specify which information is to be output in which sequence as message texts.
User bloc k
Use the "User block" tab (Report system error) to specify whether a separate user block is to be called from the diagnostic block and configure its interface.
Generate
Click on this button to generate the selected blocks, messages and error text libraries.
Delete
Click this button to delete the diagnostic block including its reference data as well as all messages and error texts.
SITRAIN training for Automation and Industrial Solutions
Page 20
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Configure the "Report system error" function (2)
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Report a system error
Page 21
03/2007 © Siemens AG 2007 - Subject to change without prior notice
S7 components and "standard DP slaves" (slaves with proper ties defined by their GSD file) can trigger organization block calls when a system error occurs (e.g. OB 82 is called when a diagnostic alarm is triggered on an analog input module). S7 components capable of diagnosis supply information about the active system error. The start information or the local data of the assigned OBs provide general information about the error location (e.g. logical address of module) and type (e.g. channel error or buffering failure). In addition, supplementary diagnostic information can be read out (with SFC 13) to specify the error more precisely (e.g. channel 0, wire break).
Alarm_S
The STEP 7 "Report system error" function pro vides a convenient way to display diagnostic information provided by the component in the form of messages. The blocks required for this function (FB 49 in the figure above) work internally with the Alarm_S or Alarm_SQ procedure and are automatically generated or edited by STEP7. The user need only download the generated or edited blocks to the CPU and transfer the standard texts to the connected HMI devices.
SITRAIN training for Automation and Industrial Solutions
Page 21
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
OB configuration + CPU response in STOP state
OB configuration
CPU at stop
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 22
03/2007 © Siemens AG 2007 - Subject to change without prior notice
General
Use the "General" tab (Report system error) to specify which function block is to be used as a diagnostic block (FB 49 in the figure). In addition, you can specify the response of "Report system error " during generation.
OB configuration
Use the "OB configuration" tab (Report system error) to specify which OBs are to be supported, which OBs are to be created or which OBs need to be added to call the "Report system error" function (FB 49).
CPU at STOP
On the "CPU in Stop mode" tab, specify the errors which will allow the CPU to remain in the RUN state and which will cause it to switch to STOP.
Messages
Use the "Messages" tab (Report system error) to specify which information is to be output in which sequence as message texts.
User bloc k
Use the "User block" tab to specify whether a separate user block must be called from the diagnostic block (FB 49) and configure its interface.
SITRAIN training for Automation and Industrial Solutions
Page 22
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Messages + User block tab
Reporting component
Message preview
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 23
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Messages
You can select the information to be displayed in the message window on this tab. You can select from the information displayed on the left in the "Available message information" field. The selected information is displayed on the right in blue in the Message Text field.
Preview
A preview of the message you have configured is displayed as an example.
Default
The original texts are restored.
SITRAIN training for Automation and Industrial Solutions
Page 23
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Diagnostic support + User block
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Diagnosis
Page 24
03/2007 © Siemens AG 2007 - Subject to change without prior notice
With version V5.4 of STEP 7, the instance DB "Detail_Diag_DB" can be specified to directly supply data to the HMI diagnostic displays. You can enter diagnostic support settings in this tab. The diagnostic support system enables a PROFINET IO or PROFIBUS DP system to supply diagnostic data from the "Report system error" FB 49 for graphic display on an HMI device.
Diagnostic displays Check the "PROFIBUS DP DB" box if you want diagnostic events to be displayed graphically on an HMI device. Check the "PROFINET IO DB" box if you want diagnostic events to be displayed graphically on an HMI device. Specify the block to be called. In the default setting, DB 125 is generated for PROFIBUS DP and DB 126 for PROFINET IO. Both data blocks are supplied with the required data. You can enter the block names absolutely or in symbolic form. If you want to change the symbols, click on the "Edit symbols" button. HMI export data
The storage path for the HMI export data is displayed here. If you want to select another storage path, click on the button on the right to select another directory.
SITRAIN training for Automation and Industrial Solutions
Page 24
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Result check using "CPU messages"
Logon for Alarm_S
CPU messages
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Generate
Page 25
03/2007 © Siemens AG 2007 - Subject to change without prior notice
To generate the required blocks (FB and DB; and depending on the settings also OBs which do not yet exist), proceed as follows: In the dialog box "Report system error " click "Generate“: The following blocks will be generated: • The error OBs for which the box "Generate OB" was checked in the "Report system error" dialog box on the "OB Configuration" tab sheet. • Diagnostic FB (default: FB 49). • Instance DB for the diagnostic FB (default: DB 49). • Optional user block which is called from the diagnostic FB.
Evaluate
1.With an active PG on the CPU, you can monitor system errors by selecting menu options "PLC CPU messages". 2.In the window which then appears, select option "A" for user messages. Now, as soon as a configured system message is activated, it will now appear in plain text in this window as illustrated above.
SITRAIN training for Automation and Industrial Solutions
Page 25
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 10 : Configure "Report system error" Report system error
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 26
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description:
Errors occurring on the DP master CPU must be displayed as error messages by the "Report system error" function.
Procedure
1.If any blocks are open in your S7 program, close them now. 2.Open the hardware configuration of the master station. 3.Select the line containing the CPU module in the module subrack and select menu commands Options Report system error .... 4.Change the entries on the "General" tab if the entered block numbers have already been assigned in your program. 5.On the OB Configuration tab, check the boxes for "Call report system error" for blocks OB86, OB82 and OB1. 6.You can retain the settings on the other tabs. Click on the Generate button. 7.Download blocks OB1, OB82, OB86, FB49 and DB49 to the master CPU. 8.Select your S7 program in the SIMATIC Manager and select menu commands PLC CPU Messages ... . 9.Check box "A" for the master CPU and minimize the message window (do not close it!). Create a slave failure and look at the message displayed in the message window which opens automatically.
SITRAIN training for Automation and Industrial Solutions
Page 26
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Enable Alarm_S messaging (WinCC flexible)
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 27
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 27
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 11 : Display Alarm_S messages Alarm view (Enhanced Objects)
Activate S7 Alarm
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 28
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Message block FB 49 and its calls have been generated in different OBs with the "Report system error" function. To ensure that the Alarm_S messages output by this message block actually appear on the touch panel, the display of "S7 messages" must be activated in the message view of the displays "Template" and "Messages".
Procedure
1.Open the WinCC flexible station "RT PC" (PC Runtime) 2.Create a new "Messages" display and insert a message view (additional objects in the toolbox). Organize the screen jumps to suit your own requirements (into or out of the start screen) 3.Open the "Messages" screen and activate the display of S7 messages (for message view properties, see figure) 4.Check whether ALARM_S messaging is enabled in WinCC flexible (message settings) 5.Open the "Template" screen and activate the display of S7 messages 6.Display the PROFIBUS address of the failed station in an output field (information (MB87) is supplied by OB86) 7.Save the edited station and start the PC Runtime 8.Check the new function by provoking •
a DP slave failure
• or a measuring-range violation by setting an excessively high voltage (> 12V) on the simulator potentiometer on systems with an analog card.
SITRAIN training for Automation and Industrial Solutions
Page 28
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Deactivating and activating slaves with SFC12
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Description
Page 29
03/2007 © Siemens AG 2007 - Subject to change without prior notice
You can use the SFC 12 "D_ACT_DP" to selectively activate and deactivate configured DP slaves. Furthermore, you can determine for each DP slave used whether it is currently activated or deactivated. The SFC 12 cannot be used for PROFIBUS PA field devices which are connected to a DP master system through a DP/PA link.
Purpose
If you configure DP slaves in a CPU which do not exist or which are currently not required, the CPU will still regularly address them. If they are deactivated they are no longer addressed by the CPU. In this way, the fastest possible DP bus cycle can be achieved and the corresponding error events do not occur.
Deactivate
When you deactivate a DP slave with SFC 12, its process outputs are set to the configured substitute values or to 0 (safe state). The corresponding DP master will then no longer access this DP slave. Deactivated DP slaves are not indicated to be faulty or missing on the fault LEDs of the DP master or the CPU. The process image of the inputs of deactivated DP slaves is refreshed with 0, i.e. it is treated in the same way as DP slaves which have failed. Please consult the online help files for the function block for more information.
Note
Don't forget the error OBs that still have to be programmed in relation to any signals in the S7 program that are no longer supplied (DI, DO).
SITRAIN training for Automation and Industrial Solutions
Page 29
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Sample program for slave deactivation
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Ac ti vate
Page 30
03/2007 © Siemens AG 2007 - Subject to change without prior notice
When you reactivate a DP slave using SFC 12, the DP master configures it and assigns the parameters (as is the case when a failed DP station recovers). Activation is complete when the slave can transfer useful data. Activation of a DP slave does not initiate the program execution error OB (OB 85) even if its inputs or outputs are part of the process image which is updated by the system. Nor is an entry made in the diagnostic buffer. Activation of the DP slave does not initiate the rack failure OB (OB 86) and the operating system does not enter anything in the diagnostic buffer.
Note
If you try to activate a deactivated slave which is physically separated from the DP bus using SFC 12, the "DP-BUSF" LED on the CPU will flash for one minute. When this monitoring time has elapsed, the SFC will output the error code W#16#80A2, the LED stops flashing and the slave remains deactivated. If it is reconnected to the DP bus at a later stage, you must reactivate the slave using SFC 12.
SITRAIN training for Automation and Industrial Solutions
Page 30
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 12 : Activate and deactivate slaves
Diagnostic address: 3FC(hex) = 1020(dec)
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Task description
Page 31
03/2007 © Siemens AG 2007 - Subject to change without prior notice
It is your task to create an option for temporarily separating the ET 200S from the master system which will not cause an error response by the DP master. The purpose of the option is to facilitate commissioning. You will use system function SFC12 to deac tivate and activate a DP slave for this purpose. The system signal is at input I1.7. As long as a 1 signal is applied, the ET 200S must remain deactivated.
Procedure
1. Program an FC12 as shown in the figure (add your own functions, e.g. interrogation of the current slave status) if necessary) 2.Also call block FC12 in OB1. 3.Open the HW configuration of the master station and select menu commands View Address overview. 4.Load all the blocks. 5.Enable input I1.7 on the simulator and monitor the reaction of the slave.
SITRAIN training for Automation and Industrial Solutions
Page 31
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
If you want to know more
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Note
Page 32
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The following pages provide additional information for reference.
SITRAIN training for Automation and Industrial Solutions
Page 32
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Diagnosis of a specific DP slave with SFC13 Slave fault
OB86 Incoming/outgoing event Master address
. . .
Slave diagnostic address/ master system
sfc13
EN
Diagnostic address: 7FD(hex) = 2044(dec) ENO RET_VAL ??.?
REQ W#16#7FC ??.? LADDR
RECORD
??.?
BUSY ??.? SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Slave diagnostics
Page 33
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Use the SFC 13 "DPNRM_DG" to read the diagnostic data of a DP slave as defined by EN 50 170. After the data have been transmitted correctly they are entered in the destination area specified by RECORD (OUT 2). The read action is started b y assigning a logical "1" to the input parameter REQ (INO) when calling SFC 13.
Structure of the slave diagnostic data The basic structure of the diagnostic data for the slave are shown in the following table. More detailed information on the DP slaves can be found in the manuals (error numbers, for example, in the NCM S7 manual). Basic structure of the slave diagnostic data Byte:
Note
Meaning:
0
Station status 1
1
Station status 2
2
Station status 3
3
Master station number
5
Manufacturer's ID (low byte)
6...
Other slave-specific diagnostics
For standard slaves which have more standard diagnostic data than 240 bytes but less than 244 bytes, the first 240 bytes are entered in the destination area and the corresponding overflow bit is set in the data.
SITRAIN training for Automation and Industrial Solutions
Page 33
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
S7 program with an SFC13 call in OB1
Pointer to the addressed data area
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 34
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Example
The figure above shows an example of how to use SFC 13 to read out the slave diagnostic data for a DP slave in the STEP 7 user program.
As sumpti ons
The following are assumed to apply to this STEP 7 user program: • The diagnostic address of the ET 200S is 1022 (3FEh). • Slave diagnostic data must be stored in DB82: from address 0.0, length 64 bytes. • The slave diagnostic data can be up to 64 bytes long.
STEP 7
The SFC13 must be called in OB1 "cyclic mode“ since only this ensures that the result data are completely written.
SITRAIN training for Automation and Industrial Solutions
Page 34
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Parameters of the SFC13 (standard diagnostics) "DPNRM_DG" EN
??.?
ENO
REQ
RET_VAL
??.?
LADDR
RECORD
??.?
BUSY
??.?
Par am et er s
Dec lar at io n
Dat a t yp e Mem or y ar ea
REQ
INPUT
BOOL
Des cr ip ti on
I, Q, M, D, L, constant REQ = 1: Request to read
LADDR
INPUT
WORD
I, Q, M, D, L, constant Configured diagnostic address of the DP slave
RET_VAL
OUTPUT
INT
I, Q, M, D, L
If an error occurs while the function is being processed, the return value contains an error code. If no error occurred, RET_VAL contains the length of the data actually transmitted.
RECORD
OUTPUT
ANY
I, Q, M, D, L
Destination for the read diagnostic data. Only data type BYTE is permissible. The minimum length of the dataset to be read or of the destination area is 6.
BUSY
OUTPUT
BOOL
I, Q, M, D, L
BUSY = 1: The read job is not yet completed.
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 35
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 35
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Diagnostics data format Station status 1 Byte Byte Byte Byte Byte Byte
0 Station status 1 Station status 2 1 Station status 3 2 3 PROFIBUS master addr . Manufacturer ID 4 Manufacturer ID 5
Bi t
Significance
Station status 2 Significance
0
The DP slave cannot b e accessed
DP slave must be reparameterized
1
The DP slave is not yet ready
Diagnostic message active
2
Configuration does not correspond with setup
Bit = " 1", if DP slave available
3
External diagnostics available
Response monitor ing activated
4
Function not supported by DP slave
Control command " FREEZE" received
Byte 6 Byte 7 : Byte 14
Identifier-related : : Diagnosis
Byte 15 : : Byte 34
Module status
5
Master cannot interpret slave response
Control command "SYNC" received
: :
6
Slave type does not match configuration
Bit is always "0"
7
DP slave configured by different master
DP slave deactivated
Channel-specific diagnosis : : SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 36
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Diagnostic data
The system function SFC 13 supplies the diagnostic data as shown in the figure on the left. Set up an array with 64 bytes in a data block. This data area is entered in the "RECORD" parameter of the SFC 13.
Station status
Station statuses 1 to 3 provide an overview of the status of a DP slave. The assignment of station status 1 and 2 can be seen in the figure on the right. Only bit 7 of station status 3 is relevant. When bit 7 = "1", there are more diagnostic messages than can be stored by the DP slave.
Master PB address
The diagnostic byte "Master PROFIBUS address" contains the PROFIBUS address of the DP master which configured the DP slave and which has read and write access to the DP slave.
Manufact urer ID
The manufacturer's ID contains a code which describes the type of DP slave e.g. 806A(hex) for ET 200S with IM 151.
ID-specific diagnosis
The ID-specific diagnostics indicate whether or not modules of the ET 200S have errors. Identifier-related diagnostics start at byte 6 and are 9 bytes long. From byte 7, a bit is set for each defective module. Bit 0 ="1“ from byte 7 is assigned to Module 1 etc.
Module status
This indicates the status of the configured modules and expands on the IDspecific diagnosis. The module status, for example, lists whether a module is missing or incorrect.
Channel-specific diagnosis
Channel-specific diagnostics provides information about channel errors in modules and expands the ID-specific diagnostics. Channel-specific diagnostics, for example, signal a break in a channel. The maximum length is limited by the maximum total length of slave diagnostics, i.e. 64 bytes.
SITRAIN training for Automation and Industrial Solutions
Page 36
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Exercise 13 : Slave analysis with SFC13
Activated with incoming event
Activated with outgoing event
From OB 86 From OB 86
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 37
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
You will use system function SFC13 for extended slave diagnostics. The diagnostic data for the slave which is currently failed will be stored in DB13.
Procedure
1. Program an FC13 function with the characteristics illustrated in the figure above 2.Call FC13 in OB1 as well and load the relevant blocks 3.Open DB13 and switch the data view 4.Provoke a fault on the ET200S and monitor the entries in DB13 5.Interpret the entries in DB13 using the electronic equipment manual for the ET200S: :\IKPBSYS\ARCHIVES). Chapter 6 also includes a description of the structure of standard diagnostic data.
SITRAIN training for Automation and Industrial Solutions
Page 37
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
SFC11: "Freezing" of DP input signals "DPSYC_FR"
EN REQ ??.?
LADDR
??.?
GROUP
??.?
MODE
ENO RET_VAL
??.?
BUSY
??.?
Parameters Declaration
Data type Memory area
Description
REQ
BOOL
I, Q, M, D, L, constant
Level-triggered control parameter REQ=1: Activate the SYNC job
INPUT
LADDR
INPUT
WORD
I, Q, M, D, L, constant
Diagnostic address of DP master in hex. format
GROUP
INPUT
BYTE
I, Q, M, D, L, constant
Group selection Bit 0 = 1: Group 1 selected Bit 1 = 1: Group 2 selected ... Bit 7 = 1: Group 8 selected You can select more than one group per job.
MODE
INPUT
BYTE
I, Q, M, D, L, constant
Job ID (coded acc. to EN 50 170 V 3) Bit 0, 1, 6, 7: reserved (value 0) Bit 4 = 1: UNSYNC is performed Bit 5 = 1: SYNC is performed
RET_VAL
OUTPUT
INT
I, Q, M, D, L
Error code. You must evaluate RET_VAL after every function block execution.
BUSY
OUTPUT
BOOL
I, Q, M, D, L
BUSY=1: The job has not yet been completed.
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Description
Page 38
03/2007 © Siemens AG 2007 - Subject to change without prior notice
You can use SFC 11 (DPSYC_FR) to freeze one or more groups of DP slaves. This is done by sending one of the following control commands or a combination of them to the groups concerned: • FREEZE (freezes the input states for the DP slaves and reads in the frozen inputs) • UNFREEZE (resets the FREEZE command)
Prerequisites
Before you issue the control commands listed above, you must use the "HW Config" tool of STEP 7 to organize the DP slaves into FREEZE groups.
FREEZE
The control command FREEZE switches the relevant DP slaves into Freeze mode. With each FREEZE command, the DP master causes the relevant DP slaves to save the current status of the inputs simultaneously. The DP master then transfers the saved data to the input data area of the CPU. The inputs or outputs are not updated until the control command UNSYNC or UNFREEZE is issued.
SITRAIN training for Automation and Industrial Solutions
Page 38
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Group assignment for SYNC and FREEZE
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 39
03/2007 © Siemens AG 2007 - Subject to change without prior notice
As si gn a DP slav e to a SYNC/FREEZE group A DP master with the appropriate functionality can send the SYNC and/or FREEZE command simultaneously to a group of different DP slaves for the purpose of synchronizing them. You have to assign the DP slaves to SYNC and FREEZE groups for this purpose. Prerequisite
You must have created a DP master system.
Procedure
Mark the symbol for the DP master system which contains the DP slave that you want to assign to a group. Select menu commands Edit Object Properties. The "Group assignment" tab sheet is displayed complete with a table in which you can assign the DP slave to SYNC/FREEZE groups.
Note
You can assign each slave to a maximum of one SYNC and one FREEZE group. Exception: When you use a CP 342-5 as a DP master, you can assign up to 8 groups (SYNC and/or FREEZE groups) to each assigned DP slave (see documentation for the CP 342-5).
SITRAIN training for Automation and Industrial Solutions
Page 39
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
S7 program for freezing DP input signals
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 40
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 40
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Evaluation with active FREEZE mode
PB address = 35 with active FREEZE signal
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 41
PB address = 6
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 41
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
Synchronization, i.e. output and freezing of digital outputs on DP slaves EN ??.?
REQ LADDR
??.?
GROUP
??.?
MODE
"DPSYC_FR"
ENO
RET_VAL BUSY
??.? ??.?
Parameters Declaration
Data type Memory area
Description
REQ
BOOL
Level-triggered control parameter REQ=1: Activate the SYNC job
INPUT
I, Q, M, D, L, constant
LADDR
INPUT
WORD
I, Q, M, D, L, constant
Diagnostic address of DP master in hex. format
GROUP
INPUT
BYTE
I, Q, M, D, L, constant
Group selection Bit 0 = 1: Group 1 selected Bit 1 = 1: Group 2 selected ... Bit 7 = 1: Group 8 selected You can select more than one group per job.
MODE
INPUT
BYTE
I, Q, M, D, L, constant
Job ID (coded acc. to EN 50 170 V 3) Bit 0, 1, 6, 7: reserved (value 0) Bit 4 = 1: UNSYNC is performed Bit 5 = 1: SYNC is performed
RET_VAL
OUTPUT
INT
I, Q, M, D, L
Error code. You must evaluate RET_VAL after every function block execution.
BUSY
OUTPUT
BOOL
I, Q, M, D, L
BUSY=1: The job has not yet been completed.
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Description
Page 42
03/2007 © Siemens AG 2007 - Subject to change without prior notice
You can use SFC 11 (DPSYC_FR) to synchronizeone or more groups of DP slaves. This is done by sending one of the following control commands or a combination of them to the g roups concerned: • SYNC (simultaneous output and freezing of output s tates for the DP slaves) • UNSYNC (resets the SYNC command)
Prerequisites
Before you issue the control commands listed above, you must use STEP 7 to organize the DP slaves in SYNC or FREEZE groups.
What is t he effect of SYNC? The control command SYNC switches the DP slaves o f the named groups to Sync mode, i.e. the DP master transfers the current output data and causes the affected DP slaves to freeze the outputs. For the subsequent output message frames, the DP slaves simply save the output data in an internal buffer, the state of the outputs remains unchanged at first. After every SYNC control command, the DP slaves of the selected group apply the output data in their buffer simultaneously to the I/O outputs to the process (simultaneous output of control signals).
SITRAIN training for Automation and Industrial Solutions
Page 42
IK-PBSYS PROFIBUS Diagnostics
Automation and Drives
S7 program for synchronizing DP output signals
SITRAIN IK-PBSYS / PROFIBUS Diagnostics
Page 43
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 43
IK-PBSYS PROFIBUS Diagnostics