Back to Aurora Vision Library Lite website
You are here: Start » System » Serial Port » SerialPort_WriteString
SerialPort_WriteString
| Header: | STD.h |
|---|---|
| Namespace: | avl |
Writes string characters to serial port.
Syntax
C++
Python
void avl::SerialPort_WriteString ( SerialPortState& ioState, int inPortId, const atl::String& inString, bool inASCIIMode, const atl::Array<int>& inTerminator )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
ioState | SerialPortState& | Object used to maintain state of the function. | ||
![]() |
inPortId | int | 0 - 7 | 0 | Identifies open port instance when working with multiple serial ports |
![]() |
inString | const String& | |||
![]() |
inASCIIMode | bool | |||
![]() |
inTerminator | const Array<int>& |
Examples
Filter writes inString characters to output buffer. By default string is send using UTF8 encoding (multi-byte).
When inASCIIMode is enabled filter will send only ASCII characters. Any attempt of sending non-ASCII character will result in domain error.
Remarks
Using the SerialPort_Config filter is necessary before using the SerialPort_WriteString filter.
Warning:All tools applied to a specific device or file should be managed within a single thread to ensure centralized tracking, traceability, and consistency throughout the process.
Errors
Using filters writing to serial port without previous configuration will cause "SerialPort not initialized" error.
List of possible exceptions:
| Error type | Description |
|---|---|
| DomainError | SerialPort_WriteString can send only ASCII characters when inASCIIMode is selected. When option inASCIIMode is enabled, filter can send only an ASCII characters. Please check ASCII table codes for more informations. |
See Also
- SerialPort_Config – Configures the serial port.
- SerialPort_WriteBuffer – Writes raw binary data from a byte buffer to serial port.
- SerialPort_WriteChar – Writes single ASCII character to device.
- SerialPort_WriteByte – Writes one character in binary mode to serial port.


