InduSoft Web Studio supports both a simple, proprietary scripting language (worksheet style) using one or more Math worksheets, as well as VBScript. Join us for a webinar where we will show you how to use either scripting language or a combination of both. Learn when to use VBScript or the native InduSoft Web Studio scripting language, and how scripts can be applied to make SCADA/HMI applications do nearly anything you require!
4. Introduction
InduSoft Web Studio (IWS) is an easy-to-use
configuration interface to designs projects for data
communication (interoperability), data manipulation
(portability), and data presentation (mobility).
Furthermore, when you need extra flexibility for
data manipulation, it offers a complete set of tools
for scripting, with full support for IntelliSense and
debugging tools to increase productivity.
5. Native Languages
Built-In Language
Portability across all platforms,
including Linux/VxWorks (IoTView)
Support for all tags, and built-in
functions
Simplest syntax
Graphic: Screen Attributes
Graphic: All animations (including
command)
Task: All tasks (including Math and
Scheduler)
VBScript Language
Flexible standard, supported by
different platforms
Wide range of documentation and
examples
Support for all tags, built-in
functions, variables, VBScript
functions, and COM objects.
Simple syntax
Graphic: Graphic Scripts, Screen
Scripts
Graphic: Command, ActiveX, .NET
Controls, Custom Widgets
Task: Script
7. Tasks Execution
Start BGTask
Execution
Group 1
Execute Group 1
Execution
Group 2
Execute Group 2
Execution
Group N
Execute Group N
F
F
F
T
T
T
Same algorithm for Math Task and Script Task
Math Task and Script Task are independent
threads, so they can run “concurrently”. The
execution of each thread is independent from
each other.
The execution field either returns FALSE (0 or
blank) or TRUE (any value different from 0).
When it is true while the thread is checking the
state of the Execution field, the respective Group
is executed.
The state of the execution field during its
respective Group execution is irrelevant.
9. Built-in Language Main Characteristics
Support for all tags and 400+ built-n functions (Arithmetic, Statistical, String, File,
Loop, etc)
Syntax for each field:
Tag and/or Expression fields: Just write the expression. E.g.: Abs(TagA)
Label, Caption, Hyperlink, Message, or File Name fields: Just write the expression
between curly brackets. E.g.: {Abs(TagA)}
Value attribution: The equal sign (=) is NEVER used to assign a value. The equal sign
(=) is ALWAYS used for comparison. In order to assign a value, write the expression in
the EXPRESSION field and the tag that should receive the value in the TAG field (Math
and Scheduler groups).
12. Interface
Library Execution Scope and Lifetime of
variables and
proceduresVariables Procedures
BGTask
(Server)
Viewer
(Local)
Global Procedures Yes Yes** Yes** Global
Graphic Scripts Yes Yes Yes
Graphic Script
*Screen Script
*Screen Controls
Screen Scripts Yes Yes Yes
Screen Script
Screen Controls
Screen Controls
(Command, ActiveX, .NET)
Yes Yes Screen Control itself
Startup Script Yes Yes Yes
Startup Script
Script Groups
Script Groups Yes Yes Script Group itself
* Using the Graphics.<Variable_or_Procedure_name> syntax.
** Global Procedures is a repository (library) of user-defined sub-routines and functions, which can be called
from any VBScript interface in the project. It is not an execution module (thread) by itself.
VBScript Scope Summary
13. User $ as a prefix to access tags and built-in functions
Declaring variables (Dim) and constants (Const)
Calling Procedures (Call) and defining parameters (ByRef, ByVal)
IntelliSense
VBScript Editor
14. Built-in $Trace() function
VBScript MsgBox function
Error Handling with On Error Resume Next / On Error Goto 0
Output Window messages
Troubleshooting – Basic tools
16. If…Then statement
executes a set of code when a
condition is true
If...Then...Else statement
selects one of two sets of lines to
execute
If...Then...ElseIf statement
selects one of many sets of lines to
execute
Select Case statement
selects one of many sets of lines to
execute
Conditional Statements
17. For…Next statement
runs code a specified number of times
For each...Next statement
selects one of two sets of lines to
execute
Do...Loop statement
selects one of many sets of lines to
execute
Looping Statements
20. InduSoft Web Studio main Database/ERP built-in functions:
$DBExecute()
$DBCursorOpenSQL()
$DBCursorClose()
$DBCursorRowCount
$DBCursorGetValue()
$DBCursorNext()
Database Interface
21. ActiveX interface (properties, methods, and events)
COM Server interface (CreateObject statement)
ActiveX and COM Servers
22. InduSoft Web Studio Technical Reference Manual (Help)
W3SCHOOLS Web Site
(http://w3schools.com/vbscript/default.asp)
Microsoft MSDN
(http://msdn.microsoft.com/en-us/library/t0aew7h6)
Additional References