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,033
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,005
hello s7-400h and wincc are connected to each other via Ethernet. I need help on how to do time synchronization
Replies
0
Views
41
Greetings I have a problem, my system is the following: wincc v8.0 (demo), logo8.3, abb m2m analyzer. I created some pages to display the...
Replies
0
Views
53
Hi, We have upgraded our laptop which includes Windows 11. It appears that WinCC flexible 2008 advanced does not support Windows 11. What...
Replies
11
Views
254
Back
Top Bottom