WinCC Flex. Run script based on value of Internal tag

If you look at the tag it has an on change event. You can select the script to run with this event. The problem is it will run when it changes to 1 and when it changes back to 0. If you only want it to run when its 1 then put another if in you script to only run the code if tag = 1.

Another thing to watch if this tag is attached to a plc then you much change the update of the tag to cycle cont. If you don't it will only update the value of the tag if its displayed on the screen. If its internal tag then you should not have this problem.
 
Hi

If SmartTags("shift_change")= True Then SmartTags("MC1_S3")=SmartTags("MC1_S2")
If SmartTags("shift_change")= True Then SmartTags("shift_change")=0

Here Shift_change is M100.2 Bit,which gets sets in PLC through a positive edge.When ever this happens value in tag MC1_S2 transferes to tag MC1_S3
///////////////////////////////////

------|M100.0|-----------(p,m100.1)--------(set,m100.2)
///////////////////////////////////
Iam calling this script through change value event of tag M100.2



Manmeet
 
Thanks Guys. Just another question. What are the mechanics behind scrips? If a script is running, does it wait to finish that task(running script) before it does other jobs such as accepting user input from a keyboard in a text box. Can a task always be running in the background? Can I create a main routine script who's job entirely is to call other scrips? Will I run into problems?
 
I "think" Flexible waits until the script is done to do other task. I say this because scripts for file open and other dialogs are not supported. I don't think they support anything that will stop the process.
 

Similar Topics

I'm continuing my Siemens education. I need some help with compatibility details. My customer has a machine that was made by a company no longer...
Replies
6
Views
4,032
Hello all. I mainly work with Siemens PLC's and panels for our machines. But now I am faced with a pilot project that has to be as price friendly...
Replies
15
Views
8,045
Hi Folks. I have an older application that weighs pallets and prints labels for them. We used to capture the time/date of weighing, but we...
Replies
2
Views
1,614
Hi, I have WinCC Felxible 2008 SP5 installed on my Windows 10. I want to program Simatic panel TP177B using USB transfer cable. But i can't...
Replies
8
Views
2,113
Hi, Is there a tool out there to convert exported CSV files from HMI Alarms to new WinCC tags with alarms ? Kind regards, C
Replies
3
Views
1,401
Back
Top Bottom