Overview

Holds a single decimal (fractional) number. Use this instead of IntTag whenever the value needs places after the decimal point — temperatures, percentages, measured distances, calculated rates, and so on.

Value

A decimal number.

Transform options

DecimalTag supports one Transform:

Transform Syntax Effect
SCALE SCALE(inMin,inMax,outMin,outMax) Rescales the raw value from an input range to an output range, using standard linear scaling:
output = ((value - inMin) / (inMax - inMin)) * (outMax - outMin) + outMin

Example: a 4–20mA sensor loop is read as a raw 4–20 and needs converting to a 0–10 bar pressure reading:

SCALE(4,20,0,10)

Type Attributes

DecimalTag also uses the Type Attributes field (separate from Transform) for two things, which can be combined:

  • A number — how many decimal places to round the value to, e.g. 2 rounds 12.3456 to 12.35.
  • A leading/trailing U — treats the value as unsigned. For a raw byte value this reads it as an unsigned 32-bit number instead of signed; for a normal numeric value it takes the absolute value (forces it positive). Combine with a decimal-places number, e.g. U2 for "unsigned, rounded to 2 decimal places".

Notes

  • Change Tolerance applies to DecimalTag when Capture Changes Only is checked — the value has to move by more than the configured tolerance to count as a change.