WinCC.net

Home
FAQs
Downloads
Feedback

FAQs

Creating a Ladder Rung Jump From WinCC

Introduction

One part of the Totally Integrated Automation (TIA) concept is that when a WinCC project is integrated into an S7 project, additional functionality is available.  Integration is characterized by:

  • Direct use of STEP 7 symbols and variables in WinCC
  • Jump to the STEP 7 hardware diagnostics from WinCC
  • STEP 7 Building block call from WinCC

This document details the steps necessary to create a ladder rung jump and also how to call up the hardware diagnostics from WinCC. 

top

Programming Ladder Rung Jump

The following steps will configure a WinCC project to display the contents of an analog value in the PLC on a bar object in WinCC and allow the user to right-click the bar object in runtime to call up the ladder code that utilises that analog value. 

It is imperative that the WinCC project has been integrated into the Step7 project to enable the ladder rung jump functionality.  If you already have an integrated project please skip steps 1 - 5 and go directly to step 6

  1. Open Simatic Manager by selecting Start Menu\Simatic\Simatic Manager

  2. Open the Step7 Project

  3. Next a WinCC project needs to be integrated into the Step7 project.  To do this pull down the Insert menu and select WinCC Object\OS
    Insert WinCC Project

  4. A WinCC project will be created and given a default name.  To rename the WinCC project, right-click on the icon and select Rename.  We will rename the project to WinCCProj

  5. Next we need to start WinCC.  To do this right-click on the WinCC project icon and select Open Object from the context specific menu
    Start WinCC From Simatic Manager 

  6. From the WinCC Explorer open the Graphics Designer editor

  7. From the Object Pallette, under the Smart Objects folder select the Bar object and draw it on the screen
    Draw the Bar object on the screen 

  8. We now need to associate the Bar object with a process tag.  This is necessary so that when we select the object in Runtime the correct symbol is referenced

  9. Pull down the View menu and select Toolbars\Tags to bring up the Tag Browser window

  10. Browse the Step7 Symbols folder and locate the PLC tag you want to link to

  11. Drag the symbol onto the Bar object.  This will link the Process Driver Connection property of the Bar object with that symbol
    The symbol has been linked to the Process Driver Connection property 

  12. Now the object is linked to the correct symbol we need to add the functionality that will allow us to select the object in Runtime and have it automatically call up the ladder code utilising the symbol.  To do this we will step through one of the Dynamic Wizards provided by WinCC

  13. Pull down the View menu and select Toolbars\Dynamic Wizard to show the Dynamic Wizard window

  14. Select the Bar object and start the Ladder Rung Jump wizard
    Start the Ladder Rung Jump Dynamic Wizard 

  15. The Dynamic Wizard start screen will appear.  Click Next
    Dynamic Wizard Start Screen

  16. The Select Trigger window will appear.  Here we specify what mouse action will trigger the Ladder Rung Jump.  Select Right Mouse Key and click Next
    Dynamic Wizard Start Screen

  17. The Set Options window will appear.  This window allows us to link a property of the selected object with a PLC tag so that in runtime the correct symbol is referenced.  Because we have already linked our symbol to the Bar object, WinCC detects this link and we need only accept the prompt.  If we had linked tags to other properties of the object as well, all links would be listed and we would have to choose the appropriate one.  However for this example we have only linked the symbol once so we can simply click Next
    Mouse action to trigger ladder rung jump

  18. The next window allows us to specify a WinCC user level which will restrict write permissions within Step7.  For this example we will not restrict permissions so select the Don't check authorisation radio button and click Next
    Restrict write permissions in Step7

  19. The final confirmation window will appear.  Click Finish
    Confirmation screen

  20. The Bar object will now have an Event Script on Mouse\Press Right which will enable the object, when right-clicked, to call up the ladder code that references the specified symbol

  21. Save the picture and switch into Runtime to test

top

Calling Hardware Diagnostics

Even though the functionality is available to call up the hardware diagnostics for a plc from within WinCC, there is no Dynamic Wizard for this.  However, using the guidelines listed below, it is as easy to call the hardware diagnostics for a plc as it is to create a ladder rung jump.  This is because the code to do both procedures is almost identical

  1. Step through the above procedure to program the graphic object to call a ladder rung jump
  2. Open the Event script now associated with the graphic object
  3. The script will contain the following two lines

    char s_prop[] = "Process"; //Properties
    GetKopFupAwl (lpszPictureName, lpszObjectName, s_prop);
    The first line defines a variable and points it to the linked property.  This linked property will be different depending on which object you are animating

    The second line calls the function that calls the ladder rung jump

  4. The function to call the hardware diagnostics is called GetHWDiag and has the exact same arguments.  Therefore all you need to do is change the function name in the script
  5. char s_prop[] = "Process"; //Properties
    GetHWDiag (lpszPictureName, lpszObjectName, s_prop);
  6. Save the graphic and switch into Runtime to test

top

 

2007 Salma Ghafoor