indusoft vbscript webinar

17
InduSoft Web Studio v7.0 VBScript

Upload: marcia-gadbois

Post on 28-Jan-2015

155 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: InduSoft VBScript Webinar

InduSoft Web Studio v7.0VBScript

Page 2: InduSoft VBScript Webinar

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.

Page 3: InduSoft VBScript Webinar

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

Page 4: InduSoft VBScript Webinar

VBScript Scope Diagram

Page 5: InduSoft VBScript Webinar

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.

Page 6: InduSoft VBScript Webinar

VBScript and Editor Basics

Declaring variables (Dim) and constants (Const)

Calling Procedures (Call) and defining parameters (ByRef, ByVal)

Intellisense

Page 7: InduSoft VBScript Webinar

Troubleshooting tools

Built-in $Trace() function

VBScript MsgBox function

Error Handling with On Error Resume Next / On Error Goto 0

Output Window messages

Page 8: InduSoft VBScript Webinar

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

Page 9: InduSoft VBScript Webinar

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

Page 10: InduSoft VBScript Webinar

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)

Page 11: InduSoft VBScript Webinar

InduSoft Web Studio functions

$RunGlobalProcedureOnServer()

$RunGlobalProcedureASync()

$RunGlobalProcedureASyncGetStatus()

$RunGlobalProcedureOnFalse()

$RunGlobalProcedureOnTrue()

$RunGlobalProcedureOnTrigger()

Page 12: InduSoft VBScript Webinar

Database Interface

InduSoft Web Studio main Database/ERP built-in functions:

$DBExecute()

$DBCursorOpenSQL()$DBCursorClose()$DBCursorRowCount$DBCursorGetValue()$DBCursorNext()

Page 13: InduSoft VBScript Webinar

ActiveX and COM Server

ActiveX interface (properties, methods, and events)

COM Server interface (CreateObject statement)

Page 14: InduSoft VBScript Webinar

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)

Page 15: InduSoft VBScript Webinar

Q & A

Page 16: InduSoft VBScript Webinar

How to Contact InduSoft

Page 17: InduSoft VBScript Webinar

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