Using VB Script in SCADA
Good news to those who used to program in VBS, Ecava IGX Script engine now supports VB (Visual Basic). To start to write your scripts using VB language in IGX Project Editor, simply save your script with the extension of *.VBS.
Other than standard VBS functions and math operations, Ecava IGX comes with a few additional functions and methods to simplify the programming work, mainly for script to communicate with the server.
For instance, function setTag “TagName”, Data
is used to set a tag’s value, where TagName is the tag’s name in string type, and Data is the variable holding value which will be set into the particular tag. While function getTag (“TagName”)
is used to get a tag’s value, it will return the value in associated data type.
Our system engineer B.G. has shared with us the simplest yet most useful demonstration for this feature. The following screenshot shows the example of setTag and getTag functions in VB script.
You can then save and run the project, the tags’ values can be monitored in IGX Server Watch Window, as shown below.
Example Condition:
VB_tag_A is less than VB_tag_B
D = A*C-B
D = 4*6-5
D = 19