SerialDevice.Parity Property

Definition

Gets or sets the parity bit for error-checking.

public:
 property SerialParity Parity { SerialParity get(); void set(SerialParity value); };
SerialParity Parity();

void Parity(SerialParity value);
public SerialParity Parity { get; set; }
var serialParity = serialDevice.parity;
serialDevice.parity = serialParity;
Public Property Parity As SerialParity

Property Value

One of the values defined in SerialParity enumeration.

Remarks

In serial communication, the parity bit is used as an error-checking procedure. In data transmission that uses parity checking, the bit format is 7 data bits-x-1 stop bit, where x is the parity bit. That bit indicates whether the number of 1s in the data byte is even or odd. The parity bit can be E (even), O (odd), M (mark), or S (space). Those values are defined in the SerialParity enumeration.

For example, if the format is 7-E-1 and the data bits are 0001000, the parity bit is set to 1 to make sure there are even number of 1s.

Applies to