SerialDevice.Parity SerialDevice.Parity SerialDevice.Parity SerialDevice.Parity SerialDevice.Parity Property

Definition

Gets or sets the parity bit for error-checking.

public : SerialParity Parity { get; set; }
SerialParity Parity();

void Parity(SerialParity parity);
public SerialParity Parity { get; set; }
Public ReadWrite Property Parity As SerialParity
var serialParity = serialDevice.parity;
serialDevice.parity = 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.