11.07.2015 Views

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong>About <strong>VBScript</strong>Visual Basic Script Language (<strong>VBScript</strong>) is one of Microsoft’s scripting languages that is commonlyassociated with Server-side and Client-side web applications. However, Microsoft has opened up<strong>VBScript</strong> to developers and now <strong>VBScript</strong> can be found in a variety of applications. <strong>InduSoft</strong> hasstandardized on <strong>VBScript</strong> since it provides a significant subset of Microsoft Visual Basic’s functionality,and <strong>VBScript</strong> supports all of Microsoft’s operating system plat<strong>for</strong>ms including Windows CE, unlike VBA(Visual Basic <strong>for</strong> Applications) which cannot support the Windows CE runtime environment.<strong>VBScript</strong> is a programming language that is often viewed as a dialect of VBA (Visual Basic <strong>for</strong>Applications), although it is really its own language. The <strong>VBScript</strong> language attempts to balanceflexibility, capability and ease of use. VBA is a subset of Visual Basic that was developed to automateMicrosoft Office applications, whereas <strong>VBScript</strong> was originally developed to support Server-side andClient-side web applications. Although <strong>VBScript</strong> and VBA provide many of the same features, there aresome differences between them, primarily due to the applications they were each developed to support.So be<strong>for</strong>e we get into details of the <strong>VBScript</strong>ing language, perhaps it is worthwhile to review how<strong>VBScript</strong> is used with <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> (IWS) or alternatively, why <strong>VBScript</strong> is included with IWS.IWS provides an easy-to-use development environment that configures predefined objects to supportan HMI/SCADA application. Applications can be built quickly and are relatively easy to support, even bysomeone other than the original developer. By comparison, programming languages such as VisualBasic can be used to develop an HMI/SCADA application, but the lower per-copy licensing cost savingsquickly gets offset by much higher development costs and support costs. A programming developmentenvironment is clearly more flexible than a configuration development environment, but there is asignificant cost associated with programming that makes it an unattractive alternative <strong>for</strong> HMI/SCADAapplications. By adding <strong>VBScript</strong> support to IWS, <strong>InduSoft</strong> lets you chose between configuration andprogramming to meet your application needs and develop applications efficiently.Using <strong>VBScript</strong> With <strong>InduSoft</strong> HMI/SCADA Applications<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> (IWS) supports both a simple, proprietary scripting language (worksheet style) using oneor more Math worksheets, as well as <strong>VBScript</strong> (new with IWS Version 6.1). Developers can use eitherscripting language or a combination of both. <strong>VBScript</strong> code is placed in one of several modules, based on thefunctionality to be per<strong>for</strong>med and the scope of the code and its variables. This subject is covered morecompletely in the <strong>VBScript</strong> Configuration and Operation in IWS section.Examples of how <strong>VBScript</strong> can be used:• To execute a logic sequence or a routine when opening or closing a screen, or while the screen is open• To execute a logic sequence in the background• Run a simple VBScipt code segment based on an IWS object’s command dynamic• Interaction with IWS Tags and control of IWS built-in functions• Manipulation of ActiveX Controls and ActiveX Control event handler• Simple file I/O (e.g. text files)• Database interfaces (e.g. via ADO.NET), especially where use of SQL is required• Interface to Windows Management Instrumentation (WMI) and <strong>Web</strong> Services (via WSDL)• Interface to Microsoft Office applications (e.g. Excel, Access, Word) and Microsoft Office componentsvia OLE Automation• Run on a <strong>Web</strong> Thin ClientWhere you should use IWS instead of <strong>VBScript</strong>• User Interface. IWS does not support Windows Scripting, which typically provides the User Interface <strong>for</strong><strong>VBScript</strong> via Forms.• Device I/O (e.g. PLC communications). <strong>VBScript</strong> does not directly support serial or networkcommunications.<strong>InduSoft</strong>, Ltd. 5

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

Saved successfully!

Ooh no, something went wrong!