Calculated Points
Any source map may contain a calculated point. Calculated points are always computed on demand, and never stored.
Supported Operations
Calculated points support basic arithemtic operators and grouping:
- Add:
+
- Subtract:
-
- Multiply:
*
- Divide:
/
- Grouping:
(5 + 5) / 3
Point Address
Calculated points always use the format calc.<id>
where the full address must be unique within the source.
Variables
Calculated points may reference other points within the same source
map. They must be defined in dependency order based on their
point_id
. In other words, a point can only reference
variables with a lower point_id
.
Variables are denoted using the local point_id
. For
example, to reference p.2
the local variable would be
$2
.
Example source map:
name | id | addr | unit | formula |
---|---|---|---|---|
Elec Wh | p.1 | av.100 | Wh | |
Elec kWh | p.2 | calc.1 | kWh | $1 / 1000 |
Example Formulas
Example | Description |
---|---|
$1 / 1000 |
Convert Wh to kWh |
$3 * (9 / 5) + 32 |
Convert °C to °F |