| Instrument Control Toolbox | ![]() |
Specify the terminator character
Description
For serial port objects, you can configure Terminator to be CR, LF, CR/LF, or LF/CR. For VISA-serial objects, you can configure Terminator to be CR or LF. If Terminator is CR, the terminator is a carriage return. If Terminator is LF, the terminator is a line feed. If Terminator is CR/LF, the terminator is a carriage return followed by a line feed. If Terminator is LF/CR, the terminator is a line feed followed by a carriage return.
When performing a write operation using the fprintf function, all occurrences of \n are replaced with the Terminator value. Note that %s\n is the default format for fprintf. A read operation with fgetl, fgets, or fscanf completes when the Terminator value is read. The terminator is ignored for binary operations.
You can also use the terminator to generate a bytes-available event when the BytesAvailableActionMode is set to terminator.
Characteristics
| Usage |
serial port, VISA-serial |
| Read only |
Never |
| Data type |
String |
Serial Port
VISA-serial
CR |
The terminator is a carriage return. |
{LF} |
The terminator is a line feed. |
Functions
Properties
| Tag | Timeout | ![]() |