Protool question (VB script related)

Johnny T

Member
Join Date
Jul 2003
Location
Fife, Scotland
Posts
642
Hi

I'm writing some software in Protool that involves a lot of tags. I've written a script that executes upon 'screen generation' along the lines of:
DB_TO_WRITE_TO = MW110
TOP_BUTTON1 = 100
TOP_BUTTON2 = 102
etc
etc

I've defined some tags that when pressed invert the bit in a Multiplexed word based on DB_TO_WRITE_TO and a 'bit' within TOP_BUTTON1 or TOP_BUTTON2 etc

So one screen may have DB_TO_WRITE_TO equal to DB150 another screen may have it as DB160 etc

MW110 updates on different screens to point to different datablocks depending on which 'program' is being modified.

The problem I'm having is that DB_TO_WRITE_TO and presumably TOP_BUTTON1 etc aren't always being changed when I enter a screen.

There are LOTS of tags on the screen and I'm wondering if this is causing a problem. I've tried adding the script twice to the 'generate screen' function in order to get it to execute twice and reduce the amount of times that it doesn't work but this hasn't helped. I've also executed the same script on the 'button up' function of the button that enters the screen (in other words the script should be actually executing three times) but occassionally the script still doesn't update the DB_TO_WRITE_TO value.

Anyone any ideas of how I can make this script definitely execute?

I was thinking of a check at the bottom of the script along the lines of:

IF DB_TO_WRITE_TO <> MW110 THEN
go through this script again...
END

I'm not sure how to write the VB though to achieve this? Is <> not equal to in VB? How do you jump within VB to start the script again?

Many thanks for any help you can give me

Cheers

JT ;-)
 
After a bit more work fault finding on this I've found that the problem is that my DB_TO_WRITE_TO updates quicker than MW110.


Is there any way to 'force' the MW110 to get updated from the PLC?

Thanks

JT
 
Right.. sorted it!


I've put the relevant marker words in the top frame of the touchscreen and just made them invisible. This ensures that they constantly update on every screen and has fixed the problem...

Now.. on to the next thing...

JT ;-)
 
Im not up on Protool but in Flexible you can set the tag update to "cycle cont" and it will update the tag all the time. By default they are "cyclic on use" and this is only updated if displayed on the screen not if they are used in a script.
 
Although I hope you don't always talk to yourself :ROFLMAO: I am glad you shared this conversation. I run into similar situations from time to time and will try to remember this.
 
DesertDog said:
Although I hope you don't always talk to yourself :ROFLMAO: I am glad you shared this conversation.

DD, There's only two people who speak to me... myself and the voices in my head... :D


CharlesM said:
Im not up on Protool but in Flexible you can set the tag update to "cycle cont" and it will update the tag all the time. By default they are "cyclic on use" and this is only updated if displayed on the screen not if they are used in a script.

You are right that you can set the tag to update continuously. I had it set to update every second. The tag would update but, by that time, the VB script had run and DB_TO_WRITE_TO had been made equal to whatever the 'tag' used to be...

By putting the tag in the header bit of the screen (ie the global bit) then it is always up to date even before I get to the relevant screen and this has fixed.

Thanks for all the tips...

Cheers

JT ;-)
 

Similar Topics

hello, I came across a example program of Siemens to write and read out/in excel but when i try to write script allways opens a new excel file...
Replies
3
Views
1,752
I have an S7 314 with a TP 270B. I'm using several inputs that are on during normal operation and off during a fault condition. I'm using these...
Replies
2
Views
4,796
Does anyone know where I can download the Simatic ProTool software? Thanks.
Replies
5
Views
1,514
Hello, I am trying to break in into project from 2012 because it may require some modifications. Currently I am in stage of trying to understand...
Replies
6
Views
2,387
Asking for a friend who has a Protool v1.0 project. He needs to migrate it, and for that he needs to first migrate to v2.51 which he does not...
Replies
2
Views
1,161
Back
Top Bottom