Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function


Panel
titleDescription

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.

Caution_friendly

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

Client permissions restrictions


Panel
titleSyntax

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

  • Parameters

String port - The previously configured serial port to use.

Char delimiter - The delimiter to read until.

Boolean includeDelimiter - If true, the delimiter will be included in the return value.

Integer timeout - Timeout in milliseconds. Default is 5000. [optional]

  • 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

Gateway, Vision Client, Perspective Session

Panel
titleCode Examples
There are no code examples for this function.
Code Block
languagepy
titleCode Snippet
# This example will read bytes from an open port called "COM1" until the delimiter character is reached.
port = "COM1"
delimiter = "$"

system.serial.readUntil(port,delimiter,True)
Panel
titleKeywords

system serial readUntil, serial.readUntil