StopBits
Specify number of bits used to indicate end of byte
Description
You can configureStopBits
to be1
,1.5
, or2
for serial port objects, or1
or2
for VISA-serial objects IfStopBits
is1
, one stop bit is used to indicate the end of data transmission. IfStopBits
is2
, two stop bits are used to indicate the end of data transmission. IfStopBits
is1.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 theDataBits
property, and the type of parity checking with theParity
property.
Characteristics
Usage |
Serial port, VISA-serial |
Read only |
Never |
Data type |
double |
Values
Default value is enclosed in braces ({}
).
Serial Port
|
One stop bit is transmitted to indicate the end of a byte. |
|
The stop bit is transferred for 150% of the normal time used to transfer one bit. |
|
Two stop bits are transmitted to indicate the end of a byte. |
VISA-Serial
|
One stop bit is transmitted to indicate the end of a byte. |
|
Two stop bits are transmitted to indicate the end of a byte |
Examples
This example shows how to set theStopBits
for a serial port object.
Create a serial port object associated with the COM1 port. The default setting forStopBits
is1
for serial port objects. Change the value to use two stop bits to indicate the end of data transmission.
s = serial('COM1'); s.StopBits = 2;