18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overview of VBScript<br />

'This procedure is executed just once when the graphic module is started<br />

Sub Graphics_OnStart()<br />

MsgBox("Welcome to the system!")<br />

End Sub<br />

'This procedure is executed continuously while the graphic module is running<br />

Sub Graphics_WhileRunning()<br />

If $UserName = "Guest" Then<br />

$MyFlag = 0<br />

End If<br />

End Sub<br />

'This procedure is executed just once when the graphic module is closed<br />

Sub Graphics_OnEnd()<br />

$LogOff()<br />

End Sub<br />

When the Sub-routines Are Executed<br />

On the Server (where <strong>InduSoft</strong> Web Studio or CEView is running):<br />

• The graphic module is the Viewer task.<br />

• The Graphics_OnStart() sub-routine is executed once on the Server when the Viewer task is launched.<br />

• The Graphics_WhileRunning() sub-routine keeps being executed on the Server while the Viewer task is<br />

running. The Graphics_OnEnd() sub-routine is executed once on the Server when the Viewer task is shut<br />

down.<br />

On the Thin Client or Secure Viewer:<br />

• The graphic module is the ISSymbol control.<br />

• The Graphics_OnStart() sub-routine is executed once on the Thin Client station after logging in<br />

successfully.<br />

• The Graphics_WhileRunning() sub-routine keeps being executed on the Thin Client station while the<br />

ISSymbol control is hosted by the Web Browser.<br />

• The Graphics_OnEnd() sub-routine is executed once on the Thin Client station when the Web Browser is<br />

shut down (or when the ISSymbol control is no longer hosted by the Web Browser).<br />

The execution of the Graphic Script sub-routines on the Server is completely independent of the execution on<br />

the Thin Client and Secure Viewer stations.<br />

Calling Graphics Script Procedures in Other VBScript Interfaces<br />

The three predefined sub-routines are strictly local to the Graphic Script interface and are executed only on<br />

the events described above. Other procedures defined in the interface, however — under the 'Procedures<br />

with local scope heading — may be called in any other Screen Script or Command animation. The<br />

procedures are called by using the syntax Graphics.procedure_name.<br />

Taking the function MyNewProcedure that was declared in the example above, you could place a Button<br />

object on your project screen and then apply a Command animation to it with the following line:<br />

$NewTag = Graphics.MyNewProcedure($OldTag)<br />

SCREEN SCRIPT<br />

To edit the screen script for a project screen, do one of the following:<br />

• On the Graphics tab of the ribbon, in the Screen group, click Script; or<br />

<strong>InduSoft</strong> Web Studio Page 765

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

Saved successfully!

Ooh no, something went wrong!