Public Variables in ProTool?

RoyDaBoy

Member
Join Date
Jun 2012
Location
Here
Posts
2
Hi All,

I'm new to the forum.

I'm working on a piece of legacy kit which is several s7-400 PLC conected to Simatic Multi Panel Touch Screens.

I need to create a VBS Public Variable (an array) that will be accessible by several Subs.

I've trawled the help files which state that there is a 'Public' Statement, but it has to be used at 'Script Level' which is 'any script outside of a procedure'.

For the life of me, I can't find a way of creating VB script outside of a procedure. All the options for creating scripts automatically wrap it up in between a pair of Sub and EndSub statements.

Can anyone advise me where this 'Script Level' area is?
How do I get to it?

o_O


Many thanks for any advice offered.
 
Protool !
Hmmm. You do know that there is a successor to this softwares successor aready ?

I think I have found the description you mention. I think that there must be a level of VBS that is a part of Microsofts standard, but not part of the VBS used in Protool or WinCC Flexible.
If you use a public variable in another script, then the compiler would have to compile all scripts to "know" this variable. And to me it seems that scripts in protool and WinCC Flexible are compiled one at a time.

Maybe you can solve the task by passing the variables as arguments from one function to another.

Another solution could be to define internal tags, and use these as global VBS variables. This I regularly do.
 
Hi Jesper,

Thanks for the reply.
Yes, we know about the successor to this software. There is a plan to upgrade to WinCC at some point in the future, but when is not yet known. So we have to slog on with poor old ProTool for now.

I did wonder about using parameter passing, perhaps using one sub that keeps track of the array of strings and is called by the other subs that need the info.

I'll have a look at using the internal tags to build some form of array as well.

Many thanks for the advice.


PS

Like the avatar, Family Guy has to be one of the funniest things on TV.
 

Similar Topics

hello dear forum, About DELTA DIAView SCADA I defined a variable in Timescript VBscript I want access this variable from within a window For...
Replies
0
Views
585
Hi all- I have an application where: - I have a fixed system with a pre-determined, static, network (say, 192.168.2.0/24). - That system...
Replies
13
Views
4,238
Hello everyone, I face a problem with setting connection between my computer and PLC using NAT addressing. I configured NAT. In private network...
Replies
2
Views
1,994
Hi, Would like some help on how to determine a public holiday in the controllogiox calendar or other methods that have been used successfully in...
Replies
8
Views
3,072
Hello all, I have two identical cells. Each have a PLC, HMI, Laser etc. The IPs are also identical so for instance both PLCs are 192.168.10.1...
Replies
10
Views
4,519
Back
Top Bottom