How to indirectly address via Popups/Faceplates/Screens in WinCC Flex

Join Date
Jul 2007
Location
Kiruna
Posts
600
Hi Guys,

At the end of my first Siemens job in years. First time user of WinCC Flex (have used WinCC SCADA in past)

What I thought would be relatively straightforward has been pretty tough going.

Basically I have 3 different modules (Pump/Switch & Pump) that I want to create a popup for and instantiate it based on device selected on process mimic.

My PLC code is written using FCs where I have all my modules setup as UDTs located in a DB.For example a Pump has 40 bytes in DB1. The first pump will be addressed as DB1.dbx0.0.

The second pump will start at DB1.dbx40.0. I hope you get the idea.

What is the best way to create a faceplate(It appears popups are not possible) and populate with the correct instance data at runtime?

I have spent all day trying to wire up events etc and have got no where.

Is it multiplexing? Tag or Addressed? Any examples only seem to point to cases where a separate DB is used for each device.

Thanks
 
Hi if it was me i would use multiplexing. Create a set of internal tags and map them to your real tags under tag>properties>multiplexing and then make a pop up by creating a popup 'area /faceplate' on a higher layer and then hiding it using animation>visibility.

WinCC flex faceplates are a different tactic altogether to the method above.

Maybe another person will have a better idea but this would work OK
Cheers
 
Hi thanks for your reply. That could work for me.

I'm having diffculty designating a layer to place my popup (well object).

Do I have to copy this object to every graphic I want to display it from?
 
Hi
For the layer, select properties>misc>layer

If you right click on the screen you can hide layers to remove clutter while your developing. I normally put my 'pop up' on layer 10 but that is only my preference.

Not sure what you mean about every graphic but the pop up will only be on that PAGE. If you use multiplex tags then one pop up could be used for say 6 pump controls based on the multiplex index with a common visibility pop up bit

Cheers
 
I assume that you're using WinccFlex 2008?

Faceplates like to be fed with structure tags but I don't think you can multiplex a structure tag. This leaves three options.

1) create all the faceplates you need and then only make the desired one visible at runtime - difficult if you have more than a few faceplates to manage.

2) use tag multiplexing, as suggested above. This can become very tag heavy if you multiplex many tags: 10 tags with 10 indices = 110 tags.

3) Use a script to calculate pointers to the required data. A tag can be defined with other tags that determine DB number byte number and bit number. In most cases the db number and bit number will be constants (assuming your UDTs are all in the same DB). The byte number can then be calculated as OffsetTo1stUDT + (UDTRequired * SizeOfUDT) + OffsetInsideUDT. 10 tags with an infinate number of indices requires 20 tags + 1 script.

I recently used method 3 to control 20 identical processes with the same screen. The operator selects which process he wishes to control and the script calculates all the pointers for that process.

Here is an example showing calculation of two pointers into a datablock. Note that the UDT size (in Bytes) is also a tag because a routine in the plc calculates the size of the UDT so that, if it is changed, all of the scripting will still calculate the correct offsets into the DB.

Code:
'NOTE: To start scripting please press <Ctrl><Space> and see the wide variety of functions.
'Write scripts by using system functions or the WinCC flexible object model. You can easily access to the
'system through the HMI runtime object. For a convenient picking of an object reference
'you can press <Alt><Right Arrow>. Design complex scripts by employing the basic features
'of the programming language VBScript and access tags directly by name e.g. tag = 5.
Dim LineNo

Dim Sizeof_HydData            'Size of Hydraulic Data UDT

Dim Offset_To_X_State        'Offset from the start of the UDT to the X State
Dim Offset_To_Y_State        'Offset from the start of the UDT to the Y State

Dim X_State_Pointer            'Pointer to State of X Hydraulic Axis
Dim Y_State_Pointer            'Pointer to State of Y Hydraulic Axis



'Set Offsets
Offset_To_X_State = 16
Offset_To_Y_State = 18


'Find UDT Sizes
LineNo = SmartTags("iLineNumber") 'Set Line Number
HmiRuntime.Trace "Line Number = " & LineNo
Sizeof_HydData = SmartTags("dbCalibration.iSizeof_HydData") 'Size of Hydraulic Data
HmiRuntime.Trace "SizeOf Hydraulics = " & Sizeof_HydData

'Calculate Pointers to States
X_State_Pointer = ((LineNo -1) * Sizeof_HydData) + Offset_To_X_State
Y_State_Pointer = ((LineNo -1) * Sizeof_HydData) + Offset_To_Y_State



'Return results to tags

SmartTags("iState_X_Pointer") = X_State_Pointer
HmiRuntime.Trace "X State pointer = " & X_State_Pointer
SmartTags("iState_Y_Pointer") = Y_State_Pointer
HmiRuntime.Trace "Y State pointer = " & Y_State_Pointer

Nick
 
What I mean is if I have valves spread across 10 screens must I paste the popup object on to each one? Im sure I will.

As long as I don't have to use different multiplex tags for each screen. That could get
Messy
 
If you used multiplexing then you wouldn't need 10 screens, only 1. Then if you want to modify it, you only have to change 1 screen and not 10.

Nick
 
If you want to display similar data on 10 different screen than a faceplate may be the best solution. Define a structure tag that matches your UDT byte for byte, define 10 instances of the structure as tags pointing to your UDTs and then design your faceplate around the structure tag.

Nick
 
OK I'm nearly there but hit another wall.

I created an object on a screen which I plan to paste on a hidden layer of graphic.

I created an Index Tag of type INT called ValveIndex with a DB address:

I then created a series of internal tags to match the same type of my tags in DB.

So when i multiplex the tags everything is ok on I/O objects but the buttons where I issue commands i.e SetBit CMD_AUT or CMD_MAN give a compile error:

"Invlaid reference parameter for system function(trigger btnAuto_OnButtonUp" in screen 13 function 'Set Bit'

Is it not possible to write to tags using multiplexing?
 
I should note:

If I look at the click event for Multiplex tag I am trying to write to it is highlighted in Orange now there is an error.

If I look up the tag database all Multiplex tags are greyed out.

Is this possible?
 
If you have a tag that contains the Db number then I would say that you need address multiplexing. If your index tag is 0-9 then use tag multiplexing. When I first started using multiplexing I used tag multiplexing but I soon came up against some limitations so now I mostly use address multiplexing for the greater flexibility that it offers but for a "one off" type project then either would be OK.

Nick
 
I jusT downloaded a sample project from Siemens website and its the same.

Tag multiplexing will not work for writing to the PLC using the SetBit command. You can display values no problem but no writing.

If I place a button on the screen and point a SitBit command to my multiplexed tag, its greyed out.

Back to the drawing board.
 

Similar Topics

Hi I'd like to indirectly address a data file but N[N7:255]:0 is thrown up an an error during verification. What I wanted to do was store recipe...
Replies
4
Views
4,408
Per title, I have an example string array Foo of datatype STRING[10] and index Bar of type DINT EQU('False',Foo[Bar]) works functionally but on...
Replies
8
Views
2,939
Hello All, I wonder if anyone can help me? I'm working for a company within a sector that has virtually zero standards of work so i've started...
Replies
2
Views
1,902
Anyway to indirectly address I/O based on slot # instead of having to first map each point to a secondary tag? Prefer to be able to address based...
Replies
14
Views
3,998
Hi all, I'm looking through some software that has LOTS of FCs that are 'orphaned' in the Program Structure (they have a cross through the box as...
Replies
5
Views
2,368
Back
Top Bottom