10.9 Local Scripts (Screen Scripts)
Screen Scripts – which run only run when the associated Screen is displayed or are called by a Pushbutton on a Screen. Screen Scripts run on the Client. Screen Scripts run at the frequency specified by the Graphic Parameters (Set Graph Param) as fast as every 25 milliseconds.
-
- Run Once when display first opened
- Run continuously while display is open by user
- Run Once when display closed
The language of Advantech WebAccess scripts is derived from TCL, an open-source scripting language commonly used for hardware-control programs. Advantech WebAccess scripts do not need to be compiled.
The components of a Advantech WebAccess Script are grouped into five Areas:
-
-
- ACTION – these are commands specific to Advantech WebAccess. They are usually similar to keymacro and pushbutton commands. They address the need for scripts to interact with real-time data, controls and users. For example, Alarm Acknowledge, GO TO a Graphic Display, Set a Value. ACTION commands enhance the standard Tcl script commands.
- KEYWORD – these commands are based on the Tcl programming language and introduce an "open source" feature to Advantech WebAccess scripts. Many standard Tcl programs are the programming language of Advantech WebAccess Scripts. The language of Advantech WebAccess scripts is derived from TCL, a scripting language commonly used for hardware-control programs. This is the If, THEN, ELSE of a programming language.
- FUNCTIONS – these are mostly the advanced arithmetic functions (sine, cosine, rounding, logarithmic functions)
- OPERATORS – a simpler math operators (multiply, divide, addition, greater than, equal to, etc) and grouping characters (parenthesis, square brackets etc.)
Additional components of Advantech WebAccess are the Tags (the real-time data) that Advantech WebAccess reads from Automation Equipment and internal tags describing Advantech WebAccess:
- IO TAGS – this is the real-time data collected from Automation Equipment such as PLCs, Controllers, VAVs, OPC Servers, etc.
- FIELD – these are Fields associated with IO TAGS, for example description, High Span, Alarm Limits, Alarms States etc.
- Daq TAG – these are internal system tags that describe the state Advantech WebAccess , for example Serial Number, Last Button Pushed, communication port status.
- LOCAL TAG – These are user defined “screen tags” internal to Advantech WebAccess and commonly used for display animation or reformatting data before presentation.
Please see Chapter 12 for detailed description of Scripts in Advantech WebAccess.
The next section shows a Step-by-Step Guide of creating the most common screen script to Rotate a Fan or Pump based on the On/Off state of a Digital Tag.