A Virtual Device calculates a new value from readings your project already collects. You define an expression, point its variables at device metrics or constants, and the result becomes a metric you can chart and alert on like any other.
Before you begin
Know the expression you intend to build, which device and metric supplies each input, and what unit the result should be in. A Virtual Device is only as correct as the inputs you point it at, and the most common mistake is a valid expression fed the wrong metric.
Adding one requires editor access on the project.
Basic information
Open Virtual devices and choose Create virtual device.
| Field | What it does |
|---|---|
| Name | How the Virtual Device appears in lists and selectors. |
| Metric name | The name of the metric it produces, such as displacement. |
| Unit group | The kind of quantity: length, pressure, temperature, angle and so on. |
| Unit | The specific unit within that group, which narrows once a group is chosen. |
Unit group and unit are not cosmetic. They are what the value carries into every chart and alert threshold downstream, so a Virtual Device declared in centimetres and an alert threshold set assuming millimetres will be wrong by a factor of ten and look entirely plausible.
Variables
Variables are the inputs. Add variable offers two kinds.
A device variable maps to one metric on one device. A constant is a fixed number you type in — calibration factors, conversion coefficients and offsets belong here rather than buried in the expression, where they are visible and easy to change later.
The table shows each variable's current value and when it was read, with a refresh control. That live value is the quickest way to confirm a variable is pointed where you think it is before you rely on the expression.
Each device variable shows its source beneath the name, and one is marked primary with a star. The primary determines when the calculation runs and supplies the reference timestamp when several inputs have to be lined up in time.
Choosing the device
The device picker groups devices by the connection they arrive on, and includes a Virtual Devices group.
That means a Virtual Device can take another Virtual Device as an input. It is genuinely useful — a unit conversion built once and reused — but it makes the dependency chain longer, and changing the one underneath changes everything above it silently.
Expression
Write the formula using your variable names.
Insert variable lists the variables you have defined, and a set of system constants including pi, e and phi.
Insert function offers the supported maths functions — square root, rounding, floor and ceiling, trigonometric and hyperbolic functions and more.
Test expression evaluates it against the variables' current values and shows the result inline. Use it every time, including after a change that looks cosmetic — renaming a variable changes what the expression refers to.
Schedule
A Virtual Device runs when its primary variable reports a new reading.
Add delay holds the calculation for a set number of minutes or hours after that reading arrives. Use it when the other inputs habitually turn up slightly later than the primary, so the calculation is not running before the data it needs exists.
Timestamp settings
When a Virtual Device uses more than one device variable, those inputs rarely arrive at the same instant. The primary supplies the reference timestamp, and every other input contributes its nearest reading from within a look-back window you set.
If no reading is found in that window, the run is skipped and no value is produced for that timestamp. So the window is a real trade-off: too narrow and output disappears whenever one instrument is late; too wide and you pair readings that are not really contemporaneous.
These settings only apply once there are at least two device variables. With a single device and some constants there is nothing to align.
Check the result before relying on it
Testing confirms the expression evaluates. It does not confirm the engineering is right.
Verify that each input's unit matches what your expression assumes, and that the output unit matches what you declared. An expression can be mathematically valid and still meaningless because a metric arrives in kPa where the formula expects Pa.
Then chart the output over a period you already understand and confirm it is the magnitude and sign you expect.
Do that before anyone builds an alert on it.
Comments
0 comments
Article is closed for comments.