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
-
Open Simatic Manager by selecting Start Menu\Simatic\Simatic
Manager
-
-
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
-
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
-
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
-
From the WinCC Explorer open the Graphics Designer
editor
-
From the Object Pallette, under the Smart
Objects folder select the Bar
object and draw it on the screen
-
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
-
Pull down the View menu and select
Toolbars\Tags to bring up the Tag Browser window
-
Browse the Step7 Symbols folder and locate the PLC
tag you want to link to
-
Drag the symbol onto the Bar object. This
will link the Process Driver Connection property of the
Bar object with that symbol
-
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
-
Pull down the View menu and select
Toolbars\Dynamic Wizard to show the Dynamic Wizard window
-
Select the Bar object and start
the Ladder Rung Jump wizard
-
The Dynamic Wizard start screen will appear. Click
Next
-
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
-
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
-
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
-
The final confirmation window will appear. Click
Finish
-
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
-
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
-
Step through the above procedure to program the
graphic object to call a ladder rung jump
-
Open the Event script now associated with the graphic
object
-
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
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
char s_prop[] = "Process";
//Properties
GetHWDiag (lpszPictureName,
lpszObjectName, s_prop);
-
Save the graphic and switch into Runtime to test
top
|