18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overview of VBScript<br />

The following illustration shows the scope of each VBScript interface and the order in which they are scanned<br />

by IWS:<br />

The illustration shows that the Global Procedures are shared by the Graphic Module and the Background<br />

Task. However, the other VBScript interfaces are either from the Graphic Module or from the Background<br />

Task, and they do not share variables or procedures between them. They are independent of each other.<br />

Note: Although the Graphics Script is scanned by IWS before the Screen Scripts, the procedures<br />

and variables declared in the Graphics Script interface are NOT available for any script interface<br />

configured on the screens. You must use the Global Procedures interface to implement procedures<br />

that must be available for all screens.<br />

When writing your code in a VBScript interface, you can access any tag from the IWS tags database or any<br />

function from the Built-in Scripting Language by applying the "$" prefix to the tag/function name, as in the<br />

examples below:<br />

$Time 'Returns the value of the tag Time from the tags database<br />

$MyTag 'Returns the value of the tag MyTag from the tags database<br />

$Open("main") 'Executes the Open() built-in function to open the "main" screen<br />

Therefore, you can create scripts using built-in functions from IWS, tags from the IWS tags database,<br />

VBScript functions, VBScript variables, ActiveX properties, methods or events, and any other interface<br />

available. The IWS tags are shared by all modules from IWS, including the Graphic Module and the<br />

Background Task.<br />

Global Procedures<br />

This Procedures interface is used create a library of VBScript functions and sub-routines that can be called<br />

by any other scripting interface in <strong>InduSoft</strong> Web Studio. The procedures declared here are never directly<br />

executed during runtime; they must be explicitly called by another script.<br />

Caution: <strong>InduSoft</strong> Web Studio will not prevent you from declaring two or more functions with the<br />

same name. (This includes functions imported from external files; see "Importing Functions from<br />

Page 760<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!