WinCC. How to call up a screen in Script?

How to call procedures within a script?

Can someone show me some sample code of call routines with in a script and passing variables.
 
I am writing VBScript in WinCC and cannot figure out how to call up an existing screen in the Script.

I don't remember the key sequence but you can call all the events from a script. I think its cntl shift space bar but I don't remember for sure. I do know if you create a new script it gives you the key sequence at the top for bringing up a list for the events you can call. You can call the screen by name or number just like the event of a button.

Can someone show me some sample code of call routines with in a script and passing variables.

I have posted some code on here before so you should be able to do a search for it. I can post more if you can give me more detail of what you need.

To read/write variables use smart tags.

smarttag("var_name") = 10

my_var = smarttag("tag_name")

edit:
http://www.plctalk.net/qanda/showthread.php?t=16734


http://www.plctalk.net/qanda/showthread.php?t=19379&highlight=script
 
Last edited:
Hope this helps

'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.

Here is a screen shot of a script doing a screen change. I did this with the script wizard. Just select the event you want to happen then apply and it writes the script for you.
Script.JPG
 
I don't think you can do a pause in the script. You could do half the script set a bit and wait (while bit set loop) till the bit clears. Then in the PLC monitor the bit and reset it with a timer.

You could also put a dead loop in the script that would loop around a few times just to give a short delay.

Why do you need a pause?
 

Similar Topics

I a new for WinCC Flexible. I use the WinCC version 7. I have tried to create a graphic screen and add the Button on the screen, then add action...
Replies
2
Views
5,047
Just wondering if anyone has seen anything like this. Just upgraded an TP170A from WinCC 2005 advanced to 2007 advanced. Everything works fine...
Replies
4
Views
2,009
Hello. I have a db which is 1000 INT, and this db is represented in WinCC as a raw data type set of 5x 400 Bytes. This set is read with a script...
Replies
1
Views
79
Hello Experts I am working on a project with WinCC Unified v16 PC system and want to create an option on the screen to export logs to the...
Replies
0
Views
69
Does anyone happen to know how to install the graphic picture in HMI when I go into blower selection there are no graphics shown not only blower...
Replies
1
Views
85
Back
Top Bottom