Skip to content

Calculated Tag Formulas ​

AudienceProcess Engineers, Plant Admins
Required Permissionstags:create / tags:update on target plant
Estimated Time8 min read
Demo Referencecemento-valladolid-cm01

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 Bad quality, including in dependent calculations.
  • Configure an input's stale timeout to expire old readings (0 disables 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 ​

OperatorMeaningExample
+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 / orLogical AND / OR (combine conditions){Temp} > 80 and {Vibration} > 5

Unsupported Operators ​

  • ^ — Use ** for exponentiation, not ^.
  • & — Use the and keyword for logical AND, not &.
  • | — Use the or keyword for logical OR, not |.

3. Whitelisted Functions ​

FunctionDescriptionExample
abs(x)Absolute valueabs({Setpoint} - {Actual})
sqrt(x)Square rootsqrt({Diff_Pressure}) * 4.5
min(a, b, …)Smallest of the given valuesmin({Temp_1}, {Temp_2})
max(a, b, …)Largest of the given valuesmax({Temp_1}, {Temp_2})
avg(a, b, …)Average (mean) of the valuesavg({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 ypow({Radius}, 2)
ln(x)Natural logarithm (base e)ln({Pressure_Ratio})
log(x, base=e)Logarithm with optional baselog({Value}, 2)
log10(x)Base-10 logarithmlog10({Concentration})
exp(x)e raised to the power xexp({Rate} * {Time})
floor(x)Round down to the nearest integerfloor({Hours})
ceil(x)Round up to the nearest integerceil({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 elseIF({Mill_Power} > 50, 1, 0)

4. Worked Examples ​

Use CaseFormula
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 temperatureavg({Bearing_Temp_1}, {Bearing_Temp_2}, {Bearing_Temp_3})
Flow from differential pressuresqrt({Diff_Pressure}) * 4.5
Constrain a value to a safe rangeclamp({Pressure}, 0, 100)
Running indicator (0 / 1)IF({Mill_Power} > 50, 1, 0)
Combined alarm conditionIF({Temp} > 80 and {Vibration} > 5, 1, 0)
Rounded, scaled readinground({Flow_Rate} / 1000, 2)

OTCognix Industrial IoT & AI Documentation