Download PDF
Transcript
µServer User Manual
10/24/14
Javascript code execution
"%SCRIPT%=instruction1_javascript;instruction2_javascript"
This syntax allows to execute any javascript instruction.
Example 12. Javascript instructions.
%SCRIPT%=window.location.href='http://www.sireagroup.com'
Link to a web address.
%SCRIPT%=alert('Test button')
Message display.
Note:
The ON value of a button can be directly a special syntax or a reference to a variable
containing the special syntax (see Section 9.3.7.1 Property replaced by a variable), offering also
a wide range of programming possibilities.
9.3.9. Global variables of a synoptic
In some cases it is interesting to create a synoptic model which could be duplicated just changing
automatically properties on certain objects.
Example:
We want to assign an identical synoptic to each device. On this synoptic, the value of several
variables of the device are shown as well as some buttons that force that variables. A synoptic
can be developed for device 1, and then it can be duplicated (copy or export/import) for the
device 2. For that, it is necessary to review all the objects to modify addresses making reference
to device 1 in order to switch them to device 2. For instance, %MW0.1 turns into %MW0.2, etc.
With the aim of avoiding this tedious manipulation, it is possible to develop a generic synoptic on
which the equipment number will be a global variable inside the synoptic.
%MW0.1 will be indicated as %MW0.{device}. Once the generic synoptic has been developed, it is
duplicated and then a modification is done on its global variables (tool bar at the synoptic editor)
just changing {device} by “1”. µServer looks for all {device} occurrences inside the
properties on all objects and change them to “1”.
By duplicating again the generic synoptic and reiterating the same operation for the device 2,
109/126