How to copy one tag to another in WinCC SCADA

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I've got a PC running WinCC SCADA v6.2.

It's connected to three S5 PLCs and I would like to copy an existing tag from PLC 1 to a tag I've made that talks to PLC 2.

So... I have a tag called:
Existing_Tag_1 - DB100.DW10 - linked to PLC 1

And this tag:
New_Tag_2 - DB100.DW10 - linked to PLC 2

... to have the same value.

The PLC's don't talk directly to one another so I need to do it through the PC.

I'm sure there's a really easy way of doing this but I'm full of a cold and been messing around with it for an hour now while my nose drips nonchalantly into my lap and I'm getting nowhere....

Could someone put me out of my misery (either by telling me how to do it or putting a bullet in my head if this cold doesn't clear up!).

Many thanks

;-)
 
I don't think WinCC has an "On Change" event like WinCCFlexible does but you can schedule a script to run cyclically that copies the value of TagX to TagY.

Nick
 
Thanks for the reply Nick. Ideally I would like to keep the overheads down as the system is already very slow so would shy away from a cyclic script if possible?

Is this the only way?

Also, do you know how I would implement a cylic script (I'm not fully conversant with VB Scripting).

Thanks

;-)
 
Create an "Action" to copy your tags and set the trigger to Cyclic and specify a time. If you're worried about loading the processor that I can only suggest that you change the trigger to a boolean tag and use the originating PLC to set the bit when new data is to be transferred.

See attached example.

Nick

CyclicAction.jpg
 
Nick,

Thanks for the script. I've never implemented a script but I'll see if I can get it to work on Monday when I'm back working on it.

Why do you have the "Set objTag = Nothing". Is "Nothing" a keyword in VB Script??

Or does this just reset the internal variable 'objTag' ??

Thanks again for your help

;-)
 
You are correct, "Nothing" is a keyword.

The "Set" instruction creates an object in memory; It's good practice to set it to "Nothing" when you've finished with it. I suspect that if you don't, you may cause a memory leak.

From the Help File:

"Nothing" Optional. Discontinues association of objectvar with any specific object or class. Assigning objectvar to Nothing releases all the system and memory resources associated with the previously referenced object when no other variable refers to it.

Nick
 
Just to let you know that I was working on that SCADA system today and your script worked a treat.

I didn't write a function in the end. I just put it in the subroutine that runs when that particular screen is 'focussed'.

This is working fine and it keeps the overhead down as it's only updating the once when the screen is entered (this is enough for my particular application).

So, I just wanted to thank you again for your effort.

Thanks Nick! ;-)
 

Similar Topics

I have two separate programs open in two instances of RSLogix5000. Each program has a user defined tag that is a large array of a user defined...
Replies
7
Views
9,355
Hi Guys, Please give me some tips about scripting in Wincc. I wanna copy a value of a Tag and transfer it to another Tag. These tags are located...
Replies
6
Views
7,392
Just curious, trying to make set up of 20 PID tags identical. What if on first scan I COPY MyPIDtag01 to MyPIDtag02 Length 1 COPY MyPIDtag01 to...
Replies
4
Views
2,918
How do you copy the contents of a dint256 tag to another dint256 tag in Controllogix while offline? I've done it online with a copy statement...
Replies
3
Views
6,020
This feels like a simple, elementary question, but I am a Siemens novice and know there are experts here. My S7-1500 project (TIA Portal v17) has...
Replies
10
Views
2,711
Back
Top Bottom