indusoft vbscript webinar
DESCRIPTION
TRANSCRIPT
InduSoft Web Studio v7.0VBScript
Why VBScript?
Easy, flexible and powerful: While easy to learn and get started by using only simple commands, you can also create very powerful functionality. Fully integrated within the InduSoft Web Studio development environment.
Many resources available: VBScript has been around since 1991, free online information and resources are abundant.
Portability and Scalability: Compatible with all Microsoft platforms supported by InduSoft, including Windows CE Mobile, Windows CE, Windows XP Embedded, Windows XP, Windows Vista, Windows 7, Windows 2003 Server, and Windows 2008 Server R2.
Create powerful SQL database interfaces quickly: Rapidly create simple interfaces or libraries that interact with any SQL database.
Interact with ActiveX objects and COM Servers programmatically: Easily interface with 3rd party ActiveX controls by simply using its name and property/method/event.
Produce reusable functions and subroutines: Have the need to reuse functionality anywhere in your project? Create your own global procedures.
Internal Structure
Viewer.exe
Studio Manager.exe
TagsDatabase
Driver Runtime
DDE Client
DDE Server OPC Client
OPC Server
Database Client Runtime
ODBC Runtime
Background Task
TCP/IP Client
TCP/IP Server
Viewer
AlarmsTrendsRecipesReportsMathScriptScheduler
VBScript Scope Diagram
VBScript Scope Summary
Interface
Library ExecutionScope and Lifetime of
variables and proceduresVariables Procedures BGTask
(Server)Viewer(Local)
Global Procedures Yes Yes Yes** Yes** Global
Graphic Scripts Yes Yes YesGraphic Script*Screen Script*Screen Controls
Screen Scripts Yes Yes Yes Screen ScriptScreen Controls
Screen Controls(Command, ActiveX, .NET) Yes Yes Screen Control itself
Startup Script Yes Yes Yes Startup ScriptScript 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 and Editor Basics
Declaring variables (Dim) and constants (Const)
Calling Procedures (Call) and defining parameters (ByRef, ByVal)
Intellisense
Troubleshooting tools
Built-in $Trace() function
VBScript MsgBox function
Error Handling with On Error Resume Next / On Error Goto 0
Output Window messages
Conditional Statements
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 statementselects one of many sets of lines to execute
Select Case statement selects one of many sets of lines to execute
Looping Statements
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 statementselects one of many sets of lines to execute
VBScript functions
Date/Time functions (DateAdd, DateDiff, etc)
Conversion functions (Asc, Chr, etc)
Format Functions (FormatDateTime, etc)
Math Functions (Rnd, Sqr, etc)
Array Functions (Ubound, etc)
String Functions (LCase, Ucase, etc)
Other Functions (MsgBox, InputBox, CreateObject, etc)
InduSoft Web Studio functions
$RunGlobalProcedureOnServer()
$RunGlobalProcedureASync()
$RunGlobalProcedureASyncGetStatus()
$RunGlobalProcedureOnFalse()
$RunGlobalProcedureOnTrue()
$RunGlobalProcedureOnTrigger()
Database Interface
InduSoft Web Studio main Database/ERP built-in functions:
$DBExecute()
$DBCursorOpenSQL()$DBCursorClose()$DBCursorRowCount$DBCursorGetValue()$DBCursorNext()
ActiveX and COM Server
ActiveX interface (properties, methods, and events)
COM Server interface (CreateObject statement)
Additional References
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)
Q & A
How to Contact InduSoft
Email(US) [email protected](Brazil) [email protected](Germany) [email protected]
Support [email protected] site
(English) www.indusoft.com(Portuguese) www.indusoft.com.br(German) www.indusoft-germany.de
Phone (512) 349-0334 (US) +55-11-3293-9139 (Brazil) +49 (0) 6227-732510 (Germany)
Toll-Free 877-INDUSOFT (877-463-8763) Fax (512) 349-0375
Contact InduSoft Today
Germany
USA
Brazil