You are here: Start » Filter Reference » System » Serial Port » SerialPort_ReadStringUntil
Module: | FoundationLite |
---|
Reads the string from the serial port to encounter a string delimiter.
Name | Type | Range | Description | |
---|---|---|---|---|
![]() |
inPortId | Integer | 0 - 7 | Identifies open port instance when working with multiple serial ports |
![]() |
inEndString | String | Delimiter string that will be searched in incoming stream. | |
![]() |
outString | String? | Conditionally returns received string without delimiter. |
Description
Filter reads characters from input buffer until find inEndString delimiter is found. Returns data without delimiter.
Result string will be read in UTF8 format.
Delimiter provided in inEndString must contains only ASCII characters.
Filter perform non-blocking reading form buffer and will return NIL when no data was read.
Remarks
Using the SerialPort_Config filter is necessary before using the SerialPort_ReadStringUntil filter.
Filter SerialPort_Config does not guarantee that input buffer will be empty.
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
Using filters reading from serial port without previous configuration will cause "SerialPort not initialized" error.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inEndString must contains only ASCII characters. Termination string must contain only ASCII characters. |
Complexity Level
This filter is available on Basic Complexity Level.
Filter Group
This filter is member of SerialPort_Read filter group.
See Also
- SerialPort_Config – Configures the serial port.
- SerialPort_ReadByte – Reads one character in binary mode from serial port.
- SerialPort_ReadBuffer – Reads raw binary data from serial port.
- SerialPort_ReadChar – Reads single character from serial port.
- SerialPort_ReadString – Reads string characters from serial port.