Application Note

Access Senquip Application Notes — detailed documents explaining configuration, integration, and data setup for each supported system.

Parsing a Serial String with a Script

APN0011  |  Revision 1.0  |  April 18, 2024

This application note explains how to use the Senquip scripting engine (mJS) to decode serial data from connected instruments such as sensors, controllers, or weigh scales. It begins by showing how to configure the serial interface for correct baud rate, parity, and line termination, then describes how to register a data_handler function that captures incoming ASCII or hexadecimal strings. Examples demonstrate parsing fixed-length frames or delimiter-based packets, converting substrings into numeric values, and dispatching them to the Portal as variables. Error handling techniques are included for incomplete or corrupted frames, along with timing strategies to avoid overlapping reads. The note concludes with a worked example that converts a streaming temperature probe output into continuous, timestamped measurements visible on the Senquip dashboard. By following the method, users can integrate almost any serial-output device using a few lines of script.

Access Application Note

Fill out the form below to access the full application note.