MergenHub Envest
Home/Docs/Modules

Advanced (virtual) tags

Expression engine, average/min/max, totalizer, derived, link, Oracle cumulative tags; function reference.

Advanced (virtual) tags compute new values from existing tags. They live under Extensions › Virtual tags, appear in OPC UA under _AdvancedTags, and can be logged, alarmed and shown on screens like any other tag.

Extensions › Virtual tags — list and expression editor
Extensions › Virtual tags — list and expression editor

Types

TypePurposeNotes
Expression (Derived)any formula over input tagsevaluated on change or at a fixed period; math, logic, comparison, string and time functions
Averagerolling or window averagerun-gated: only accumulates while a run tag is true
Minimum / Maximummin/max over a windowresettable, run-gated
Totalizerintegrates a rate over time (m³/h → m³)units per hour/minute/second, persistent across restarts, reset tag
Cumulative (Oracle-style)difference-based countershandles rollover
Linkcopies a tag to another (write-back)for mapping between devices or protocols
Triggerraises a boolean pulse on conditionsfor screens and Data Bridge

Expression language

IF(Plant.PLC1.Flow > 100 AND Plant.PLC1.Pump1_Run, Plant.PLC1.Flow * 1.05, 0)
ROUND(AVG(Tank1.Level, Tank2.Level), 1)
CLAMP((Raw - 4) / 16 * 100, 0, 100)          // 4–20 mA to percent
LERP(0, 100, Raw / 65535)                       // linear interpolation
POLY(Raw, 0.0012, -0.3, 12.5)                   // polynomial
MAP(Raw, 0, 1023, 0, 10)                        // range mapping

Available functions include arithmetic, ABS ROUND FLOOR CEIL MIN MAX AVG SUM, trigonometry, IF AND OR NOT, comparisons, string functions, NOW() HOUR() MINUTE(), PREV(tag) (previous value), AGE(tag) (seconds since last update), QUALITY(tag), RANDOM(). The editor has Validate which checks syntax and shows a live evaluation.

Quality propagation

If any input is Bad, the result is Bad unless the expression handles it explicitly with QUALITY(). Missing inputs are reported in the tag's status column and in the event log.

Persistence

Totalizers and cumulative tags save their state to disk every 30 s and on shutdown, so a restart or power loss does not reset accumulated volumes.

Performance

Virtual tags evaluate in the core process on their own schedule; thousands of them are fine. Prefer on change evaluation for expressions that depend on slowly changing tags.