bg

Script execute filter

Latest version: 5.0.1 build 1126. November 28, 2025.

The Script Execute filter module extends our data loggers with a flexible scripting engine that can process, filter, and transform incoming data packets before export. It supports several scripting languages in the same environment. This allows you to implement custom business logic without changing the main application. The plugin works on any supported system and does not depend on 3rd-party applications.

This plugin is intended for technical professionals who need to perform custom calculations, modify parser variables, or implement conditional routing based on incoming data. Instead of writing a separate external application, you can embed the required logic directly inside the data logging chain. The result is a compact and maintainable configuration where parsing, transformation, and export steps are defined in one place.

Download  | PDF manual

Script Execute supports PascalScript, C++Script, JScript, and BasicScript. You can choose your preferred language in your configuration. The engine provides a wide range of programming language features such as variables, constants, functions, procedures, standard operators, and exception handling. It also offers type compatibility checking, access to standard helper classes, and the ability to keep values between executions.

Practical example: packet filtering and variable modification

The following scenario shows how Script Execute can filter incoming packets in Advanced Serial Data Logger and adjust parser variables. Assume a device sends periodic status lines through a serial port in this format:

2025-01-02 08:00:00;DEVICE01;TEMP=24.5;STATE=OK
2025-01-02 08:00:00;DEVICE01;TEMP=99.9;STATE=OVERHEAT
2025-01-02 08:00:00;DEVICE01;TEMP=32.1;STATE=OK

The data logger's parser extracts the following variables:

DATE_TIME_STAMP = "2025-01-02 08:00:00"
DEVICE_ID       = "DEVICE01"
TEMP_VALUE      = 24.5
STATE_VALUE     = "OK"

Now you want to implement a rule that:

  • Discards packets where "STATE_VALUE" is not "OK".
  • Flags values above 30 degrees by creating the new "HIGH_TEMP_FLAG" variable.
  • Reformat the temperature to one decimal place.

You can select "Script Execute" as a filter after the parser. In PascalScript the script could look like this:

var
 temp: double;
begin
  // Drop packet if state is not OK
  if GetVariable('STATE_VALUE') <> 'OK' then
  begin
    DiscardDataPacket();
    exit;
  end;

  // Normalize temperature format
  temp := GetVariable('TEMP_VALUE');
  SetVariable('TEMP_VALUE', FormatFloat('0.0', temp));

  // Add new flag variable
  if temp > 30.0 then
    SetVariable('HIGH_TEMP_FLAG', '1')
  else
    SetVariable('HIGH_TEMP_FLAG', '0');
end.

With this script, the second line with STATE=OVERHEAT is completely removed from the further processing chain. The remaining packets receive a new "HIGH_TEMP_FLAG" variable that can be exported to a database, file, or OPC tag. This keeps the export data clean and standardized without changing the main logger configuration.

2025-01-02 08:00:00;DEVICE01;TEMP=24.5;STATE=OK;HIGH_TEMP_FLAG=0
2025-01-02 08:00:00;DEVICE01;TEMP=32.1;STATE=OK;HIGH_TEMP_FLAG=1

Key features

  • Support for multiple scripting languages in one environment, including PascalScript, C++Script, JScript, and BasicScript.
  • Support with variables, constants, functions, standard operators, exception handling, and type checking.
  • Direct access to helper classes such as TStrings and TFileStream for advanced string and file operations.
  • Ability to modify existing parser variables, create new variables, and control packet flow, including discarding packets.
  • Support for sending strings, bytes, or data arrays to data sources like COM or TCP ports as responses or commands.
  • Simple configuration with script editor, syntax checking, and script load and save options for reuse.

Summary

Script Execute adds a powerful scripting layer to our data loggers. It lets you implement complex rules, calculations, and responses without changing your devices or core logging configuration. By applying scripts to your data, you can create data processing solutions that are precisely tuned to your needs.

Download  | PDF manual

Product Buy Download Support Contacts site map
Copyright © 1999 - 2025, AGG Software.
All rights reserved. Terms of use | Privacy policy