18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

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><br />

Command Dynamic<br />

A Command Dynamic is associated with a specific object on a Screen, and allows one or more actions<br />

to take place when an event occurs with the specific object. A typical use is a button (perhaps a<br />

rectangle) that is placed on the screen. When an operator selects on the button (via mouse click or<br />

pressing a touch screen over the object), this action is expected to initiate some action. That action may<br />

be to set/reset a PLC bit, jump to a different screen, whatever. The Command Dynamic allows the<br />

developer to choose what action to take.<br />

With Version 6.1, IWS adds new capability to the Command Dynamic interface. In addition to the IWS<br />

built-in language command, the Command Dynamic can now execute <strong>VBScript</strong> code. The steps to<br />

access the <strong>VBScript</strong> interface within a Command Dynamic are:<br />

1. Select the object on the Screen currently opened in the IWS workspace. If the object has<br />

a Command Dynamic associated with it, then right click on the object. Otherwise, click on<br />

the Command Dynamic icon (right) from the Mode toolbar and then right click on the<br />

object.<br />

2. Now, the Object Properties dialog box <strong>for</strong> the<br />

Command Dynamic will open. Click on the Config…<br />

button in the lower right corner of the dialog box.<br />

3. Select the event condition (e.g. On Down) where<br />

your want code to be execute and then select<br />

<strong>VBScript</strong> as the Type.<br />

4. Enter your <strong>VBScript</strong> code (variable declarations<br />

and executable statements).<br />

Within the Command Dynamic, you enter <strong>VBScript</strong><br />

variables and executable statements subject to the<br />

following conditions:<br />

• Any variable declared in this interface will only<br />

have a local scope.<br />

• You cannot implement procedures (i.e.<br />

Subroutines or Functions) within this interface.<br />

Notwithstanding these restrictions, <strong>VBScript</strong> code within<br />

a Command Dynamic still has access to all Global<br />

Procedures.<br />

<strong>VBScript</strong> code within the Command Dynamic interface is<br />

executed whenever one or more of the selected event<br />

conditions (listed in the Command Dynamic configuration screen) occur <strong>for</strong> the selected object. The<br />

execution of the Command Object script on the Server executes independently from the execution on<br />

<strong>Web</strong> Thin Clients.<br />

Key Notes:<br />

• Be<strong>for</strong>e executing the application, be sure to save (or close) the Screen after any<br />

<strong>VBScript</strong> is entered. Otherwise it might not be updated. This is true <strong>for</strong> all <strong>VBScript</strong><br />

interfaces.<br />

<strong>InduSoft</strong>, Ltd. 49

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

Saved successfully!

Ooh no, something went wrong!