Instrument Control Toolbox    
Terminator

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

Values

Serial Port

CR
The terminator is a carriage return.
{LF}
The terminator is a line feed.
CR/LF
The terminator is a carriage return followed by a line feed.
LF/CR
The terminator is a line feed followed by a carriage return.

VISA-serial

CR
The terminator is a carriage return.
{LF}
The terminator is a line feed.

See Also

Functions

fgetl, fgets, fprintf, fscanf

Properties

BytesAvailableActionMode


 Tag Timeout