Skip to content

Calculated pens

A calculated pen is computed in the browser from other pens on the chart: on the data on screen, and on the raw data when you export.

Adding a calculated pen: the derivative of a flow per hour

  1. Click + Calculated pen at the bottom of the Tags tab.
  2. Pick Input A (and Input B for a sum or difference). Each input shows its whole tag path.
  3. Pick a calculation: Derivative (per second), Derivative (per hour), Delta, Offset, Scale, Sum or Difference. The editor shows a worked example in your pens' names and unit.
  4. Check the Name and Unit it suggests, and click Add.

Or write an expression yourself in Expression. How to write an expression lists what it takes.

Pens are referred to in braces, by their id ({p1}, shown in the pen list) or by name ({Line 1 outlet flow}).

Expression Result
derivative({p1}) Change per second; derivative({p1}, 3600) per hour
delta({p1}) Change since the previous point
offset({p1}, -2.5), scale({p1}, 1000) Shifted or scaled
sum({p1}, {p2}), avg(...), min(...), max(...) Combined at every timestamp of any input
({p1} - {p2}) / {p2} * 100 Any arithmetic with + - * / ^, abs()

When the pen is added, names become the ids of the pens they name, so renaming or removing a pen never makes the calculation use another one. A removed input is reported on the pen.

Open the calculated pen's settings: its expression is under its name ("= Line1/Flow / 60"), and Edit the expression… opens it. Changes to a calculated pen apply with Apply, not as you type, because a half-typed expression is not a pen.

Calculated pens take limits only as typed values. The full rules are in the expressions reference.