|
PortController.NET
Parity Property
Sets and returns the parity communications parameter.
Syntax
[Visual Basic]
object.Parity [ = value ]
[C#]
object.Parity [ = value ]
[C++]
object->Parity [ = value ]
Parameters
object
An object expression that evaluates to a PortController object.
value
A value of type ParityValue indicating the parity setting.
Return Value
A value of type ParityValue representing the parity setting.
Remarks
- Parity values are contained in the SciCom.PortController.ParityValue namespace
- Valid parity values are as follows:
- Parity_None (Default)
- Parity_Odd
- Parity_Even
- Parity_Mark
- Parity_Space
Default
Parity_None
Errors
Attempting to set Parity to an invalid value
will cause PortController to throw an "Invalid argument" exception.
Example
[Visual Basic]
'Set parity
myPortController.Parity = SciCom.PortController.ParityValue.Parity_None
'Get parity
Dim parity as SciCom.PortController.ParityValue
parity = myPortController.Parity
[C#]
// Set parity
myPortController.Parity = SciCom.PortController.ParityValue.Parity_None;
// Get parity
SciCom.PortController.ParityValue parity = myPortController.Parity;
[C++]
// Set parity
myPortController->Parity = SciCom::PortController::ParityValue::Parity_None;
// Get parity
SciCom::PortController::ParityValue parity = myPortController->Parity;
See Also
DataBits property | BaudRate property | StopBits property | Open method
|