Expressions filter
Latest version: 5.0.1 build 1126. November 28, 2025.
The Expressions filter module is an expression engine for our data logger software (e.g., Advanced Serial Data Logger or Advanced TCP/IP Data Logger). It evaluates formulas, applies logical rules, and transforms parsed values in real time before export. You can combine arithmetic, string, date, time, and boolean operations in one place and use the results as normal parser variables in all export modules.
The plugin supports different data types, including string, date, time, decimal, float, and boolean values. You can use arithmetic operators such as +, -, *, /, and exponentiation (^) together with math functions like ABS, ATAN, COS, EXP, LN, ROUND, SIN, SQRT, SQR, and TRUNC. String functions such as COPY, REPLACE, and POS help you normalize or reformat device messages. Logical operators and functions like AND, OR, and XOR let you build decision logic inside a data logging configuration without external scripts or code.
Core Concept and Expression Syntax
The basic configuration model is simple. Each line in the Expressions filter is one assignment of the form:
VARIABLE_NAME = EXPRESSION
Here VARIABLE_NAME is a new or existing parser variable name, and EXPRESSION is any valid formula that can use operators, functions, constants, and other parser variables. You can reference all existing parser variables that the parser module exposes, including numeric values, strings, and timestamps. You can also introduce new calculated variables and use them in subsequent expressions or in any export module as if they were native parser variables.
For example, in a MODBUS-based temperature monitoring system, the MODBUS parser may extract the raw value from register 40001 into a variable called TEMP_RAW. You can then define a corrected temperature variable:
TEMP_C = ROUND(TEMP_RAW * 0.1 - 2.5, 1)
If the input TEMP_RAW is 275, the plugin will calculate: TEMP_C = ROUND(275 * 0.1 - 2.5, 1) = ROUND(27.5 - 2.5, 1) = ROUND(25.0, 1) = 25.0. The new variable TEMP_C is then available in the export module for CSV, database, or through OPC.
Practical Calculation Examples
The Expressions filter is useful in many typical data logging scenarios where you need to convert raw values, compute derived metrics, or perform conditional logic. Below are several examples that show how you can use math functions, string functions, and boolean logic in real projects.
Example 1: Signal to noise ratio from raw level values
SIGNAL_LEVEL = 23.5 NOISE_LEVEL = 3.2 SNR = ROUND(SIGNAL_LEVEL / NOISE_LEVEL, 2) GOOD_SIGNAL = (SNR > 5) AND (SNR < 20)
If the incoming data contains values for SIGNAL_LEVEL and NOISE_LEVEL, the plugin calculates the signal to noise ratio and sets a boolean flag GOOD_SIGNAL. You can export SNR and GOOD_SIGNAL to CSV or database fields and use them to trigger alerts or highlight rows in report tools.
Example 2: Formatting a combined message string
DEVICE_ID = "PLC_01"
ALARM_TEXT = "Overheat"
ALARM_CODE = "A123"
FULL_ALARM_TEXT = DEVICE_ID + ": " + ALARM_TEXT + " (" + ALARM_CODE + ")"
You can also rework text fields. With string functions such as COPY and REPLACE you can adjust proprietary device formats. For instance, if a device sends status codes as "OK,OK,ERR,OK", you can extract the first item using:
Key features
- Supports arithmetic, string, date, time, and boolean expressions with multiple bracket levels.
- Provides rich function sets including math (ABS, SQRT, LN, ROUND), string (COPY, REPLACE, POS), and logical operators (AND, OR, XOR).
- Allows creation of new parser variables and modification of existing ones for use in all export modules.
- Integrates with most of our data loggers.
- Offers a simple configuration editor with function and variable dropdown lists to reduce syntax errors.
- Works in real time, computing derived values for each received record before export.
Summary
The Expressions filter module adds a flexible calculation layer to data loggers. It lets you compute derived data, enrich messages, and apply logic rules right in the logging pipeline without external scripts. Formulas in your configuration allow you to get data ready for exporting without requiring any post-processing in your analytics or reporting system.
Read more about other plugins:
All plugins | Deadband | Expressions | Aggregator | Digital inputs filter | Script execute | Events generator | Redirect data | Redirecting data to a TCP server | Data timeout | Alarms Professional | Data Encode | Data From List | Failover | Summary statistics