omron — Graphics Script

Appendix: VBScript Important: Do not change the name of the predefined sub-routines. If you do, then the system will not be able to automatically execute them. Example:

'Variables with local scope can be declared and initialized here Dim MyDate MyDate = Date() Dim MyValue MyValue = 100 'Procedures with local scope can be implemented here Function MyNewProcedure(nCount) MyNewProcedure = nCount + 1 End Function Function AreaRec(side1, side2) AreaRec = side1 * side2 End Function Sub CheckHiLimit(myValue, myHiLimit) If myValue > myHiLimit Then MsgBox("Value out of range") End If End Sub 'This procedure is executed just once when the graphic module is started Sub Graphics_OnStart() MsgBox("Welcome to the system!") End Sub 'This procedure is executed continuously while the graphic module is running Sub Graphics_WhileRunning() If $UserName = "Guest" Then $MyFlag = 0 End If End Sub 'This procedure is executed just once when the graphic module is closed Sub Graphics_OnEnd() $LogOff() End Sub When the Sub-routines Are Executed On the Server (where InduSoft Web Studio or CEView is running):

• The graphic module is the Viewer task. • The Graphics_OnStart() sub-routine is executed once on the Server when the Viewer task is launched. • The Graphics_WhileRunning() sub-routine keeps being executed on the Server while the Viewer task is running. The Graphics_OnEnd() sub-routine is executed once on the Server when the Viewer task is shut down. On the Thin Client or Secure Viewer: • The graphic module is the ISSymbol control. • The Graphics_OnStart() sub-routine is executed once on the Thin Client station after logging in successfully. • The Graphics_WhileRunning() sub-routine keeps being executed on the Thin Client station while the ISSymbol control is hosted by the Web Browser.

• The Graphics_OnEnd() sub-routine is executed once on the Thin Client station when the Web Browser is shut down (or when the ISSymbol control is no longer hosted by the Web Browser). The execution of the Graphic Script sub-routines on the Server is completely independent of the execution on the Thin Client and Secure Viewer stations. Calling Graphics Script Procedures in Other VBScript Interfaces InduSoft Web Studio Page 645