User Manual

Table Of Contents
Advanced functionality
Creating a button to command multiple data points
7
A6V11604297_en--_g
187 | 195
Command
Description
Program code to paste into the first line of
the PROGRAM EDITOR
Release ALL dampers
readAll() searches the entire database and
returns multiple records.
The parameter to readAll is a tag query that
functionally describes some point or set of
points.
finstack.eval('readAll(shadowPoin
t and damper and
cmd).colToList("pointRef").each
x=> baPointRelease(x)');
Override any preheater valves found, up
to a maximum of 10, to 25%.
readAll() is using a semantic tag query to
find any points matching some description
(possibly more than one point).
The parameter to readAll is a tag query that
functionally describes some point or set of
points.
.getSafe(0..n) selects a number of records
from the total number of records returned by
readAll()
In this example, if fewer than ten items
are found, they are safely enumerated,
avoiding any indexing errors.
If more than ten items are found, the
first ten found are enumerated. (This
selection is random.)
baPointCommand() is executed once for
each point selected by getSafe(0..n).
The x parameter is baPointcommand() is
replaced with a selected point.
The second parameter to baPointOverride()
is the value to command (in this example, it
is hard-coded to 25% using a literal value).
finstack.eval('readAll(shadowPoin
t and valve and cmd and equipRef-
>preheater).getSafe(0..9).colToLi
st("pointRef").each x=>
baPointOverride(x,25)');
Override all preheater valves to some
value configured on a specific Button
readAll() searches the entire database and
returns multiple records.
The parameter to readAll is a tag query that
functionally describes some point or set of
points, including a description of the parent
equipment (equipRef).
The $1 parameter in baPointCommand() is
replaced with the value assigned to the
writeVal property tag belonging to the
specific button that invoked the program.
finstack.eval(sprintf('readAll(sh
adowPoint and valve and cmd and
equipRef-
>preheater).colToList("pointRef")
.each x=>
baPointOverride(x,$1)',this.write
Val));
Override the preheater valve in
whichever target (for example, plant) the
graphic is currently viewing to some
value configured on a specific Button.
Note
This example illustrates how to adapt
syntax for a relativized, re-usable
graphic.
read() searches the entire database and
returns just one record (the first match).
The parameter to read() is a query for
exactly one item matching the unique id of
the point.
The $1 parameter in baPointCommand() is
replaced with the value assigned to the
writeVal property tag belonging to the
specific button that invoked the program.
finstack.eval(sprintf('read(shado
wPoint and valve and cmd and
equipRef->preheater and equipRef-
>equipRef==$id)-
>pointRef.baPointOverride($1)',th
is.writeVal));