Escolar Documentos
Profissional Documentos
Cultura Documentos
Overview
In this chapter we will show you a common example of working with S7 PDIAG and ProAgent. We will guide you step by step through the entire configuration by showing you an example relating to address monitoring.
Even if you use S7 Graph instead of S7 PDIAG, this example will graphically show you how to get started with process diagnostics using ProAgent. While you cannot directly apply the descriptions to WinCC and the OS, the numerous illustrations will give you a clear idea of all the processes. If you do not use S7 PDIAG, you can skip Sections 1.1 up to and including 1.8.
In Section 1.1 1.2 1.3 1.4 1.5 1.6 1.7 You Will Find Getting Started with S7 PDIAG Using Address Monitoring as an Example. Creating the Sample Project and Sample Program. Configuring Address Monitoring for FB11 and FB12. Adding a Call to OB1 and Creating an Instance Data Block for FB10. Generating Instance-Specific Error Definitions. Generating Monitoring Blocks. Adding a Call for Monitoring Blocks to OB1 and Downloading the Sample Program to the Programmable Logic Controller. How to Test your Sample Process Diagnostics with S7 PDIAG. Getting Started with ProAgent for WinCC Creating a WinCC OS in Your Step7 Project Starting WinCC and Performing Settings Configuring and Starting WinCC RunTime Computer Properties Performing Process Diagnostics on Your WinCC OS on Page 1-2 1-3 1-6 1-9 1-10 1-12 1-14
1-1
1.1
Introduction
This section aims to show you how to work with S7 PDIAG using address monitoring as an example.
The diagram below gives you an overview of the procedure for configuring address monitoring with S7 PDIAG:
Section 1.2
Section 1.2
Section 1.3
Adding a call to OB1 and creating an instance data block for FB10
Section 1.4
Section 1.5
Section 1.6
Adding a call to OB1 and downloading monitoring blocks to the programmable logic controller
Section 1.7
Section 1.8
Figure 1-1
1-2
1.2
First, use the STEP 7 Wizard to create a new project with the name ExPDIAG in the SIMATIC Manager. Insert an S7 program under your corresponding hardware configuration. Afterwards, configure the connection of the CPU to the physical network (MPI, PROFIBUS, Industrial Ethernet, etc.).
Select the block container for your project ExPDIAG under the S7 program below your hardware configuration in the SIMATIC Manager and create the following function blocks using the menu command Insert " S7 Block " Function Block:
Insert the UDT_Unit (UDT1) from the project S7_DIAG (supplied with the software) in your sample project ExPDIAG. This is necessary, because this user data type is required by S7 PDIAG for monitoring and controlling units.
Executability
In order for the example to run on the programmable logic controller, input byte 0 and output byte 1 must be interconnected on digital modules. If you only have one CPU but no digital modules, insert OB122 (I/O access error) and monitor your parameters using the menu command Monitor/Modify Variables.
1-3
Programming FB11
Open FB11 in the SIMATIC Manger by double-clicking it and fill in the variable declaration table and the code section in the LAD/STL/FBD Editor as follows: 1. Enter Unit as the name and UDT1 as the type in the stat row of the variable declaration table. 2. Enter the following in the first network of the code section: Network name: Operation Q1.0 in FB11 Program: A I0.0 A I0.1 = Q1.0
3. Enter the following in the second network of the code section: Network name: Group error FB11 Program: A #Unit. Group_Error = Q1.6
"
Programming FB12
Open FB12 in the SIMATIC Manger by double-clicking it and fill in the variable declaration table and the code section in the LAD/STL/FBD Editor as follows: 1. Enter the following in the stat row of the variable declaration table: Unit as the name and UDT1 as the type, and ST_Memory_Bit as the name and BOOL as the type. 2. Enter the following in the first network of the code section: Network name: Operation ST_Memory_Bit in FB12 Program: A I0.6 A I0.7 = Q1.1 = #ST_Memory_Bit
3. Enter the following in the second network of the code section: Network name: Group error FB12 Program: A #Unit. Group_Error = Q1.7
"
1-4
Programming FB10
Open FB10 in the SIMATIC Manger by double-clicking it and fill in the variable declaration table and the code section in the LAD/STL/FBD Editor as follows: 1. Enter the following in the stat row of the variable declaration table: Unit_10 as the name and UDT1 as the type, and Unit_11 as the name and FB11 as the type, and Unit_12 as the name and FB12 as the type. 2. Enter the following in the first network of the code section: Network name: Subordinate units Program: CALL #Unit_11 CALL #Unit_12
3. Enter the following in the second network of the code section: Network name: Group error FB10 Program: A #Unit_10. Group_Error = Q1.5
"
Save.
1-5
1.3
Introduction
Now that you have programmed the blocks for the sample program, you can create an address monitoring definition for these blocks.
Requirements
In order for S7 PDIAG to create the data required for process diagnostics, you must: 1. Activate the check box Store Process Diagnostics Data. To do this, select the menu command Options " Customize in the LAD/ STL/FBD Editor and activate the above check box in the Create Block tab. Exit the dialog box with OK. 2. Enable your block to contain diagnostic data. This occurs automatically for FB11 and FB12 if you configure an error definition in the block. FB10 must be assigned an attribute to enable it to contain diagnostic data.
Since FB10 does not have an error definition, this block cannot automatically receive diagnostic data. You must therefore assign the following attribute for FB10.
Attribute S7_pdiag Value true Assign this attribute if: Information is to be generated for S7 PDIAG For Block FB, FC, OB, and DB
To assign the above system attribute to a block, proceed as follows: 1. Select the menu command File " Properties while the block FB10 is open in the LAD/STL/FBD Editor. Result: The dialog box containing the block properties is displayed. 2. Select the Attributes tab and enter the attribute from the above table. 3. Exit the dialog box with OK and save the block in the Editor using the menu command File " Save. Then exit the Editor. Note: The block information required by S7 PDIAG is now stored. This occurs for every block with the S7_pdiag attribute, but only if the check box Store Process Diagnostics Data is activated (standard setting).
1-6
In the following steps, you create an address monitoring definition for each of the function blocks you programmed earlier: 1. Open FB11 in the SIMATIC Manager by double-clicking it. The LAD/ STL/FBD Editor opens. 2. In the example, output Q1.0 is to be monitored. Address monitoring should therefore be added for this output. To do this, place the cursor in the instruction line = Q1.0 and open the Process Monitoring dialog box using the menu command Edit " Special Object Properties Monitoring. 3. Select the option S7 PDIAG: Address Monitoring in the Templates field and click New. Result: The Definitiontab in the S7 PDIAG: Address Monitoring dialog box is displayed. The initial diagnostic address displayed is the address in the instruction line, here Q1.0.
Figure 1-2
4. Activate the option Level 1 in the Monitoring group field (if it is not already preset), so that Q1.0 will be monitored for level 1. With this setting, an error message is triggered by S7 PDIAG when Q1.0 has the level 1.
1-7
5. To assign the corresponding message text to this error message, enter the following in the Message group field: Q1.0 in FB11 has level 1. 6. Exit the tabbed sheet with OK. You have now configured an address monitoring definition for Q1.0 at level 1. This is now displayed in the Process Monitoring dialog box under Existing Monitoring Definitions. 7. Exit the Process Monitoring dialog box with Close. 8. Save the block using the menu command File " Save, so that the new error definition is saved in the block and exit the LAD/STL/FBD Editor.
Configure address monitoring for the variable ST_Memory_Bit in FB12 in the same way. In this case, replace the message text with the following: ST_Memory_Bit in FB12 has level 1.
1-8
1.4
Adding a Call to OB1 and Creating an Instance Data Block for FB10
Introduction
Now that you have programmed your blocks and configured address monitoring, you can add a call for these blocks in OB1 and create the instance data block for FB10 at the same time.
Procedure
Insert the following call for FB10 at the end of OB1 in the ExPDIAG project: CALL FB10, DB10 Click Yes in the next dialog box to create the new instance data block (here: DB10) (see Figure 1-3).
LAD/STL/FBD (30:150) Instance data block DB10 does not exist. Do you want to generate it?
No
Details...
Help
Result: DB10 is created with the data relevant to S7 PDIAG and also receives the S7 PDIAG attribute. Save the block using the menu command File STL/FBD Editor.
"
1-9
1.5
Introduction
The following steps show you how to generate instance-specific error definitions in S7 PDIAG.
Procedure
To generate instance-specific error definitions, proceed as follows: 1. Select the block container in the SIMATIC Manager and open S7 PDIAG using the menu command Options " Configure Process Monitoring. Result: The units relevant to S7 PDIAG are displayed in the unit overview; here FB10, 11, 12, and DB10, as shown in Figure 1-4.
C Process Diagnostics-ExPDIAG\SIMATIC 400 Station(1)\UR2\CPU416-2 DP(1)\S7 Program(1) Process Diagnostics Edit Insert PLC View Options Window Help
Ready
Figure 1-4
2. By clicking in the left-hand window on the + in front of the unit for DB10, you will see the structure of the units in your user program. You can see that FB11 is stored as Unit_11 and FB12 as Unit_12 under [DB10/FB10] and consequently under Unit_10. 3. By clicking a unit (here, FB11), the configured error definitions for this unit are displayed on the right-hand side of the unit overview. 4. By double-clicking an error definition in the right-hand window, you can open the appropriate dialog box for editing this error definition.
1-10
5. Close any error definitions which are open and select the menu command Process Diagnostics " Generate Instances. Result: The error definitions assigned to the function blocks are transferred to the corresponding instance data blocks using the menu command Generate Instances. The message texts stored in the function blocks are added to the instances and message numbers are assigned. You will see this if you compare the initial diagnostic address of the error definition in the unit for FB12 with the initial diagnostic address of the error definition under the unit DB10.Unit_12. DB10 now contains the address DB10.Unit_12.ST_Memory_Bit as the initial diagnostic address instead of the memory bit ST_Memory_Bit. Proceed by opening the Object Properties dialog box in the Name window, while the operand to be monitored is selected. The function block therefore contains a template for the error definition which is then transferred accordingly to the individual instances, and the formal parameters which are replaced by symbolic names, symbol comments, or absolute addresses, depending on the default settings. Of course, this only applies to function blocks, since only function blocks can have instances.
1-11
1.6
Introduction
The following steps show you how to generate monitoring blocks from error definitions.
Procedure
To generate the monitoring blocks, proceed as follows: 1. Save and close all blocks in the LAD/STL/FBD Editor. 2. Select the menu command Process Diagnostics " Compile in S7 PDIAG. If you are compiling for the first time, you will be requested to check the compilation settings. Confirm this message with OK. 3. Open the Customize dialog box using the menu command Options " Customize and, in the Default Settings tab, enter the number 110 for the error-detection blocks to be compiled, and 111 for the initial value / status acquisition blocks, as shown in Figure 1-5.
1-12
Figure 1-5
4. Exit the dialog box by clicking OK. A progress bar appears and the monitoring blocks are generated. If an error occurs during compilation, a message will appear on the screen. Result: The generated monitoring blocks are displayed in the SIMATIC Manager together with the system function blocks (SFCs) required for them.
1-13
1.7
Adding a Call for Monitoring Blocks to OB1 and Downloading the Sample Program to the Programmable Logic Controller
Introduction
In order for the monitoring blocks you generated to become active, you must download them to your programmable logic controller and add a call for these blocks in OB1, or at the required point in your user program.
Requirements
You have generated the monitoring blocks for your entire user program.
To add the call for the generated error-detection block in OB1, proceed as follows: 1. Open OB1 in the SIMATIC Manager by double-clicking it. 2. Insert the following lines: CALL FB110, DB110 PDIAGZyklus: = OB1_SCAN_1 Note: FB110 contains the error detection. If an error is detected in FB110, this block automatically calls FB111, which is responsible for initial value / status acquisition. 3. Save the block and close the LAD/STL/FBD Editor.
You can download the sample program ExPDIAG from the SIMATIC Manager to your programmable logic controller. Proceed as follows: 1. Select the block container in the SIMATIC Manager. 2. Download the sample program to your CPU using the menu command PLC " Download.
1-14
1.8
Introduction
Now that you have been through the whole configuration process with S7 PDIAG using the example, you can simulate a process error and display the configured messages via the CPU Messages application. You will also see how a group error functions.
Requirements
In order to view the messages without a display device, you must start the CPU Messages application in the standard package. Proceed as follows: 1. Switch to online mode in the SIMATIC Manager. Result: The online project window appears. 2. Select the sample program ExPDiag. 3. Start the CPU Messages application using the menu command PLC " CPU Messages.... 4. Activate the check box under A in the Customize dialog box which appears so that you can display Alarm_S messages, and close the dialog box. Now that you have made all the settings for displaying error messages in the CPU Messages application, you can start triggering process errors.
S Set inputs I0.0 and I0.1 at the same time. If you do not have any digital
modules, you can do this using the menu command Monitor/Modify Variables. Result: This causes output Q1.0 in FB11 to be set to level 1. This is recognized as an error by S7 PDIAG because of the configured error definition. An error message will appear with the message text you entered. This error message now appears in the CPU Messages window. At the same time, outputs Q1.5 and Q1.6 are set by the user program via the group error bit (Group_Error) check. These outputs display the group error messages: Output Q1.6 shows that an error (Q1.0 = level 1) has just occurred in Unit_11 (FB11). Output Q1.5 is also set, because Unit_11 (FB11) lies below Unit_10 (FB10) in the hierarchy; that is, the fault is transferred to the unit above it.
1-15
S Set inputs I0.6 and I0.7 at the same time. If you do not have a simulator
module, you can do this using the menu command Monitor/Modify Variables. Result: This causes output Q1.1 in FB12 to be set to level 1. This is recognized as an error by S7 PDIAG because of the configured error definition. An error message will appear with the message text you entered. This error message now appears in the CPU Messages window. At the same time, outputs Q1.5 and Q1.7 are set by the user program via the group error bit (Group_Error) check. These outputs display the group error messages: Output Q1.7 shows that an error (Q1.1 = level 1) has just occurred in Unit_12 (FB12). Output Q1.5 is also set, because Unit_12 (FB12) lies below Unit_10 (FB10) in the hierarchy; that is, the fault is transferred to the unit above it.
In the previous sections, you have learned step-by-step how to use S7 PDIAG to create a STEP 7 program for diagnosing processes. You will now learn how to create a configuration for diagnosing processes on a display device (hereafter referred to as OS) using the WinCC configuration software and the corresponding optional package ProAgent for WinCC (from the SIMATIC HMI product family). This section will then show you how to diagnose a process yourself on the OS. This will familiarize you with the different diagnostic screens.
1-16
1.9
Introduction
In the following we will show you how you can create a project with diagnostics capability in WinCC for the preceding example.
Requirements
Before you can configure process diagnostics in WinCC, you have to generate the watchdog modules for your application program in a proper manner, as described at the beginning of this chapter.
Operating unit
All the illustrations in the following description show a PC representing a display device. However, the procedure is identical for all display devices.
Overview of procedure
The following illustration gives you an overview of the procedure for performing a process diagnosis on your operating unit:
Section 1.10
Section 1.11
Section 1.12
Section 1.13
Figure 1-6
1-17
Introduction
Before you can configure a WinCC OS, you must create an OS in your example project.
Procedure
To configure diagnosis pictures, perform the following steps: 1. If you have not already done so, start SIMATIC Manager and open the project called BspPDIAG. 2. In SIMATIC Manager, choose Insert " WinCC Object " OS from the menu. Result: The BspPDIAG file now looks as follows:
Figure 1-7
1-18
Introduction
The next step is to start WinCC and perform the necessary settings. This includes:
6. Restart WinCC in SIMATIC Manager by choosing the OS button and choosing Edit " Object " Open from the menu.
Figure 1-8
1-19
Selecting units
Finally, select the units for which you want to perform process diagnostics. Perform the following steps: 1. Choose Editors " ProAgent " Open from the menu in WinCC. 2. Click Units in the ProAgent editor. 3. Select PLC_1 and click the >> button, and apply the dialog box.
Figure 1-9
Selecting Units
4. Start the generating run by selecting Generate in the ProAgent editor. 5. Following successful generation, close the ProAgent editor by clicking OK. If no network connection has been configured, the error message No diagnostic capable units have been found in the S7 project will be displayed.
1-20
Introduction
Following generation of the diagnostic data, you have to configure the WinCC OS.
Procedure
Perform the following steps: 1. Select the entry called Compute. 2. In WinCC, choose Edit " Properties from the menu. 3. Click the Properties button. 4. Select the Startup tab and select the following items:
S S S S
Text Library Runtime Global Script Runtime Alarm Logging Runtime Graphics Runtime
1-21
5. Select the Graphics-Runtime tab and enter the picture called UserBild.PDL as the start picture. 6. In the Window Attributes box, select Full Screen and apply the dialog box.
7. You can now start WinCC Runtime by choosing File mence work on process diagnostics.
"
1-22
Introduction
As you configured the WinCC OS in the preceding sections, you can now perform process diagnostics.
Requirements
Before you can perform process diagnostics on the OS, you must successfully complete all the steps described in the preceding sections:
S the PLC program has to be loaded on the CPU, and S the WinCC project must have been compiled successfully
The following description shows all the figures for a WinCC PC as being representative of an operator station. The displays on an FI45 are almost identical.
Start picture
After WinCC Runtime has started, the selected diagnostics start picture appears first.
1-23
Here you can choose between changing to the overview picture or changing to the message picture. Change to the message picture first by pressing the appropriate key.
Message picture
Initially, the message picture is blank, as no errors have occurred. Simulate an error in FB 11, as you did previously in Section 1.8. An error then appears at the OS:
The asterisk to the left of the message indicates that this message can be diagnosed. Since only one message has been displayed until now, it has already been selected. When several messages are displayed, you have to use the arrow keys first to select the message which you wish to diagnose. Then, press the button to display the overview picture.
1-24
In the overview picture that follows you can see the faulted unit 11 as well as unit 12.
A warning triangle identifies the faulted unit. The warning triangle is flashing since this is the first error to occur. If the error had involved consequential errors, warning symbols would likewise appear for the affected units but they would not flash. The flashing warning triangle indicates where an error occurred first. That is where you will find the cause of the error and its consequential errors in many instances. The faulty unit has already been selected. Press F2 to go to the higher-level unit.
1-25
In the next overview picture you can see the higher-level unit in this instance the DB 10.
You can now see the higher-level unit. This unit is similarly identified as being faulty since at least one of its subunits is faulty. An error always spreads upwards in the hierarchy. Above the list of units you can now see a rightpointing arrow. This arrow indicates that the there are hierarchically lowerlevel units belonging to the unit.
1-26
Press F1 to go down one level in the hierarchy. You will again see a display containing the two subunits. Go up or down with the faulty unit. arrow keys to move the selection bar to the
1-27
Detail Picture
The Detail Picture shows precisely those signals that have been triggered by the alarm message.
Change to LAD display Figure 1-17 Here You See the Detail Picture in STL Display
If you prefer a display in LAD, you can simply change the display by means of a soft key. The signals that triggered the alarm message are identified by a lightning symbol. The address monitoring defined in Section Getting Started with S7-PDIAG monitors output O1.0. The error message is triggered when O1.0 reaches level 1. This is the case in the present instance. You can see what caused it on the detail display: Input I 0.0 and input I 0.1 both have the status 1. In keeping with the assignment, output O 1.0 has similarly achieved status 1. To eliminate the error, the status of at least one of the inputs has to be reset to 0.
You have now simulated an error, the alarm message of which is monitored on the OP, and its cause is determined. If you like, you can now simulate an error in FB 12, too, and see how this additional error appears in the diagnostic pictures.
1-28
Additional information
You have seen how to configure process diagnostics in WinCC in this chapter and how it runs on the OS. You now already know the most important steps and sequences. Of course, we could not show you all the options available to you in ProAgent in this simple example. In practice, you will normally have your own pictures which you will wish to combine with the diagnosis pictures, and you may even wish to customize the diagnosis pictures. You will find detailed information on this and other subjects in online Help and in the ProAgent user manual.
1-29