Main Content

StopBits

Specify number of bits used to indicate end of byte

Description

You can configureStopBitsto be1,1.5, or2for serial port objects, or1or2for VISA-serial objects IfStopBitsis1, one stop bit is used to indicate the end of data transmission. IfStopBitsis2, two stop bits are used to indicate the end of data transmission. IfStopBitsis1.5, the stop bit is transferred for 150% of the normal time used to transfer one bit.

Note

Both the computer and the instrument must be configured to transmit the same number of stop bits.

除了停止位,串行数据形式at consists of a start bit, between five and eight data bits, and possibly a parity bit. You specify the number of data bits with theDataBitsproperty, and the type of parity checking with theParityproperty.

Characteristics

Usage

Serial port, VISA-serial

Read only

Never

Data type

double

Values

Default value is enclosed in braces ({}).

Serial Port

{1}

One stop bit is transmitted to indicate the end of a byte.

1.5

The stop bit is transferred for 150% of the normal time used to transfer one bit.

2

Two stop bits are transmitted to indicate the end of a byte.

VISA-Serial

{1}

One stop bit is transmitted to indicate the end of a byte.

2

Two stop bits are transmitted to indicate the end of a byte

Examples

This example shows how to set theStopBitsfor a serial port object.

Create a serial port object associated with the COM1 port. The default setting forStopBitsis1for serial port objects. Change the value to use two stop bits to indicate the end of data transmission.

s = serial('COM1'); s.StopBits = 2;

See Also

Properties

DataBits,Parity