Specify type of parity checking
You can configure
Parity to be
parity checking is not performed and the parity bit is not transmitted.
odd, the number
of mark bits (1s) in the data is counted, and the parity bit is asserted
or unasserted to obtain an odd number of mark bits. If
the number of mark bits in the data is counted, and the parity bit
is asserted or unasserted to obtain an even number of mark bits. If
the parity bit is asserted. If
the parity bit is unasserted.
Parity checking can detect errors of one bit only. An error in two bits might cause the data to have a seemingly valid parity, when in fact it is incorrect. To learn more about parity checking, refer to Parity Bit.
In addition to the parity bit, the serial data format consists
of a start bit, between five and eight data bits, and one or two stop
bits. You specify the number of data bits with the
and the number of stop bits with the
Serial port, VISA-serial
No parity checking
Odd parity checking
Even parity checking
Mark parity checking
Space parity checking
This example shows how to set the parity for a serial port object.
Create a serial port object associated with the COM1 port. The
default setting for
so if you want to use parity checking, change the value to the type
you want to use, for example, odd.
s = serial('COM1'); s.Parity = 'odd';