ASCII data query and parser plugin for Data Loggers
Latest version: 5.0.1 build 313. March 20, 2025.
This plugin adds ASCII parsing and query capabilities to our data logging software. It receives data from a data source and extracts variables. If it is necessary, the plugin can send commands to a device and poll it. Use the plugin when you collect measurements, log events, or control instruments. The plugin includes advanced parsers for fixed-format, delimited, or pattern-based data using regular expressions. It also handles binary and hex fragments when needed.
Key capabilities
- Send ASCII requests to a device, including hex bytes in #XX format (for example, "#02INIT#03"). Define request timing: once at startup, at regular polling intervals, or at specified times (e.g., "08:00:00").
- Wait for device responses with configurable timeouts.
- Split incoming stream into packets by begin/end markers or by timeout.
- Extract variables by fixed position, by order (enumeration), or by regular expression. You can also set defaults or create empty variables when needed.
- Translate or remove unwanted characters before parsing (for example, strip nonprintable control bytes).
- Filter packets to ignore or process only specific messages using text matches or regular expressions.
- Add timestamp and data source name fields to each parsed packet for traceability.
Typical examples
Example 1 - fixed-position record:
223 741 09127 15:53:30 00:05:28 O **********************************
- Set parsing to Fixed position.
- Define variables: subscriber (chars 1-3), called number (cols 11-13), time (cols 26-33), and duration (cols 34-41).
- Mark types for time and integers to export correctly.
Example 2 - delimited data:
TEMP,25.4,2025-11-28 08:00:00
- Use the comma as a separator.
- Map fields to variables: type, value, and timestamp.
- Convert the timestamp format to the "Date" data type to store data in databases.
Example 3 - Barcode reader data
Setup: A barcode reader sends scanned codes over a serial port. You can use Advanced Serial Data Logger (ASDL) to collect, display, and export records.
Incoming stream example (each scan arrives on a new line):
BC1234567890Recommended configuration:
- Packet splitting: use line ending ASCII characters as packet terminator (for example, #0D#0A) or enable timeout-based splitting if terminators vary.
- Parsing type: Fixed position - the parser should extract a barcode from column 1 and interpret it as a string.
- Filtering: add a rule to ignore empty scans or to process only codes matching a pattern like ^BC\d{10}$.
- Requests: If the reader supports polling, create a request sent by ASDL every 5 seconds to trigger a read. Configure timeout to wait for the response before the next request.
Example of combining query and parsing:
- ASDL sends a poll string "#02READ#03" every 5 seconds.
- The reader returns: BC1234567890#0D#0A
- The parser splits the packet on #0D#0A, enumerates fields, validates the barcode pattern, adds DATE_TIME_STAMP if needed, and passes data to other filter and export plugins.
Practical tips
- When packet markers use nonprinting characters, specify them as #XX in configuration (for example, #0D#0A).
- To detect packet start when its first fields vary (like a timestamp), use a small regular expression for the beginning marker, for example, \d{4}\-\d{2}\-\d{2} to match "2025-11-28".
- Use character translation to drop carriage returns or control bytes before parsing.
- Control packet length when your device always sends fixed-length frames. Set the length to ignore malformed packets.
- Test filters with sample data. Create both Ignore and Parse rules to prevent unwanted data from being exported.
Read more about other plugins:
All plugins | ASCII Data Query and Parser | MODBUS RTU, MODBUS TCP, MODBUS ASCII | Scale Data Parser | DNP3 protocol | GE Fanuc Automation PLC (via CCM, SNP, SNP-X protocols) | Siemens SIMATIK PLC (S7-200, S7-300, S7-400, S5) | EtherNet/IP | M-Bus | Bacnet/IP | IEC 62056-21 | DLMS/COSEM | DL-T645-2007 | CJ/T 188-2004 | Kamstrup [KMP protocol] | Data parser module for ADAM, ICP-CON and NuDAM devices | RFC3164 (syslog protocol) data parser | HTTP data parser | File requests | XML Data Parser | CSV or delimited data parser | RFID Protocols Data Parser (LLRP, ISO 18000-6B, ISO 18000-6C) | JSON parser