Skip to main content
Version: 7.9

system.serial.readUntil

This function is used in Python Scripting.

Description

Reads a byte at a time from a serial port until a delimiter character is encountered. The read will block for up to timeout milliseconds before returning.

If the delimiter is not found before the timeout period, then the buffer will dump, potentially resulting in data loss.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.serial.readUntil(port, delimiter, includeDelimiter, timeout)

Parameters

TypeParameterDescription
StringportThe previously configured serial port to use.
chardelimiterThe delimiter to read until.
booleanincludeDelimiterIf true, the delimiter will be included in the return value.
inttimeoutOptional timeout in milliseconds. Default is 5000.

Returns

String - Returns a String containing all 8-bit ASCII characters read until the delimiter was reached, and including the delimiter if the "includeDelimiter" parameter was true.

Scope

All