Calculated Tag Formulas
A calculated tag stores the result of a formula evaluated in real time from the live values of other tags in the same plant. This reference documents tag referencing, validation rules, whitelisted operators, functions, and worked examples.
1. Referencing Other Tags
Reference another tag by wrapping its Source Tag in braces ({SourceTag}). Braces are required because real industrial identifiers (such as BM-201 or Mill/Feed) are not valid bare names.
text
{Outlet_Temp} - {Inlet_Temp}Validation & Live Evaluation Rules
- Each formula must reference at least one Interface or Calculated tag in the same plant. Manual tags and constant-only formulas are not supported.
- A syntactically valid formula can be saved even before a current sample exists. The Edit and Test Formula panel separately reports missing inputs or runtime calculation errors.
- Missing, invalid, or expired inputs produce no numeric result and
Badquality, including in dependent calculations. - Configure an input's stale timeout to expire old readings (
0disables expiration). Fresh usable inputs allow the calculation to recover automatically. - Excel imports validate references across the entire batch: cycles, invalid formulas, and rows depending on rejected rows are rejected. Update dependent formulas before renaming, deleting, or converting inputs to Manual.
2. Operators
| Operator | Meaning | Example |
|---|---|---|
+ | Add | {Power_A} + {Power_B} |
- | Subtract | {Outlet_Temp} - {Inlet_Temp} |
* | Multiply | {Belt_Speed} * {Belt_Load} |
/ | Divide | {Mill_Power} / {Feed_Rate} |
// | Floor divide (integer division) | {Total_Count} // 60 |
% | Modulo (remainder) | {Cycle_Count} % 12 |
** | Power (exponent) | {Radius} ** 2 |
< <= > >= | Comparisons — return 1 (true) or 0 (false) | {Temp} > 80 |
== != | Equal / not equal | {Mode} == 2 |
and / or | Logical AND / OR (combine conditions) | {Temp} > 80 and {Vibration} > 5 |
Unsupported Operators
^— Use**for exponentiation, not^.&— Use theandkeyword for logical AND, not&.|— Use theorkeyword for logical OR, not|.
3. Whitelisted Functions
| Function | Description | Example |
|---|---|---|
abs(x) | Absolute value | abs({Setpoint} - {Actual}) |
sqrt(x) | Square root | sqrt({Diff_Pressure}) * 4.5 |
min(a, b, …) | Smallest of the given values | min({Temp_1}, {Temp_2}) |
max(a, b, …) | Largest of the given values | max({Temp_1}, {Temp_2}) |
avg(a, b, …) | Average (mean) of the values | avg({Bearing_1}, {Bearing_2}, {Bearing_3}) |
mean(a, b, …) | Alias of avg() | mean({Flow_A}, {Flow_B}) |
round(x, n=0) | Round to n decimal places (default 0) | round({Flow_Rate} / 1000, 2) |
pow(x, y) | x raised to the power y | pow({Radius}, 2) |
ln(x) | Natural logarithm (base e) | ln({Pressure_Ratio}) |
log(x, base=e) | Logarithm with optional base | log({Value}, 2) |
log10(x) | Base-10 logarithm | log10({Concentration}) |
exp(x) | e raised to the power x | exp({Rate} * {Time}) |
floor(x) | Round down to the nearest integer | floor({Hours}) |
ceil(x) | Round up to the nearest integer | ceil({Batches}) |
clamp(x, lo, hi) | Constrain x to [lo, hi] | clamp({Pressure}, 0, 100) |
IF(condition, then, else) | Return then when condition is non-zero, otherwise else | IF({Mill_Power} > 50, 1, 0) |
4. Worked Examples
| Use Case | Formula |
|---|---|
| Temperature rise across equipment | {Outlet_Temp} - {Inlet_Temp} |
| Mass flow from belt speed and load | {Belt_Speed} * {Belt_Load} * 3.6 |
| Efficiency as a percentage | {Power_Out} / {Power_In} * 100 |
| Specific energy consumption (kWh/t) | {Mill_Power} / {Feed_Rate} |
| Average bearing temperature | avg({Bearing_Temp_1}, {Bearing_Temp_2}, {Bearing_Temp_3}) |
| Flow from differential pressure | sqrt({Diff_Pressure}) * 4.5 |
| Constrain a value to a safe range | clamp({Pressure}, 0, 100) |
Running indicator (0 / 1) | IF({Mill_Power} > 50, 1, 0) |
| Combined alarm condition | IF({Temp} > 80 and {Vibration} > 5, 1, 0) |
| Rounded, scaled reading | round({Flow_Rate} / 1000, 2) |