Expression operators reference
Register references (${...}) are resolved first; the resulting numeric values are then passed to the expression parser.
Arithmetic operators
Operator |
Operation |
Example |
|---|---|---|
|
Addition |
|
|
Subtraction |
|
|
Multiplication |
|
|
Division |
|
|
Exponentiation |
|
|
Modulus (integers only) |
|
Bitwise operators
Operands are truncated to 32-bit integers before the operation.
Operator |
Operation |
Example |
|---|---|---|
|
Bitwise AND |
|
|
Bitwise OR |
|
|
Right shift |
|
|
Left shift |
|
Comparison operators
Return 1.0 (true) or 0.0 (false).
Operator |
Meaning |
|---|---|
|
Equal |
|
Not equal |
|
Less than |
|
Greater than |
|
Less than or equal |
|
Greater than or equal |
Logical operators
Operator |
Meaning |
Notes |
|---|---|---|
|
Logical AND |
Returns |
|
Logical OR |
Returns |
Operator precedence (high to low)
^*,/,%>>,<<+,-&|<,>,<=,>=,==,!=&&||?:(ternary)
Use parentheses to override precedence.
Unary operators
Operator |
Meaning |
|---|---|
|
Negate |
|
Identity (no effect) |
Number literals
Format |
Prefix |
Example |
|---|---|---|
Decimal |
none |
|
Hexadecimal |
|
|
Binary |
|
|
Decimal separator: ModbusScope uses the first separator it encounters — . or , — for the entire expression. Mixing both in one expression is invalid.
Function argument separator: ; (regardless of locale).
Limitations
No math functions (
sin,cos,sqrt, etc.) are available.No string operations.
No state between samples: each expression is evaluated independently per poll cycle.
No access to previous sample values.