omron — Screen Script

Appendix: VBScript The three predefined sub-routines are strictly local to the Graphic Script interface and are executed only on the events described above. Other procedures defined in the interface, however — under the 'Procedures with local scope heading — may be called in any other Screen Script or Command animation. The procedures are called by using the syntax Graphics. procedure_name . Taking the function MyNewProcedure that was declared in the example above, you could place a Button object on your project screen and then apply a Command animation to it with the following line:

$NewTag = Graphics.MyNewProcedure($OldTag) SCREEN SCRIPT To edit the screen script for a project screen, do one of the following: • On the Graphics tab of the ribbon, in the Screen group, click Script ; or • Right-click in the screen and then select Screen Script option from the shortcut menu. This interface can be used to execute logics on the following events, based on preconfigured sub-routines: • Screen_IsClosedByReplace() : This procedure determines whether the screen is automatically closed when another screen is opened to replace it. If the procedure is given a value of 0 or FALSE , then automatic closing is disabled.

When the function is given a positive value (e.g., 1 ) or TRUE , or if the procedure is not declared at all, then automatic closing is enabled. • Screen_OnOpen() : The code configured within this sub-routine is automatically executed just once when the screen is opened. • Screen_WhileOpen() : The code configured within this sub-routine is automatically executed continuously while its screen is open. The rate in which this sub-routine is called depends on the performance of the platform where the project is running. • Screen_OnClose() :The code configured within this sub-routine is automatically executed just once when the screen is closed.

The variables and procedures declared in this interface are available for the VBScript interfaces of the screen where the Screen Script is configured. Caution: Do not change the names of the preconfigured sub-routines described above. If you do, then the system will not be able to call them. Note: • The execution of the Screen Script sub-routines on the server is totally independent of the execution on the Thin Client stations. In other words, these sub-routines are executed asynchronously. • The procedures and/or variables declared in the Screen Script interface have local scope. They can be called only from the specific screen on which they are declared. Example:

'Variables available on this screen can be declared and initialized here Dim Counter 'Procedures available on this screen can be implemented here Function AreaCircle(radius) AreaCircle = Sqr(radius) * $Pi() End Function Sub CheckLoLimit (myValue, myLoLimit) If myValue Page 646 InduSoft Web Studio