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.
 

 

The language of Advantech WebAccess/SCADA scripts is derived from TCL, an open-source scripting language commonly used for hardware-control programs.  Advantech WebAccess/SCADA scripts do not need to be compiled.

The components of a Advantech WebAccess/SCADA Script are grouped into five Areas:

      • ACTION – these are commands specific to Advantech WebAccess/SCADA. 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/SCADA scripts.  Many standard Tcl programs are the programming language of Advantech WebAccess/SCADA Scripts.  The language of Advantech WebAccess/SCADA 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/SCADA are the Tags (the real-time data) that  Advantech WebAccess/SCADA reads from Automation Equipment  and internal tags describing Advantech WebAccess/SCADA:

Please see Chapter 12 for detailed description of Scripts in Advantech WebAccess/SCADA.

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.