|
PortController.NET
BaudRate Property
Sets and returns the baud rate communications parameter.
Syntax
[Visual Basic]
object.BaudRate [ = value ]
[C#]
object.BaudRate [ = value ]
[C++]
object->BaudRate [ = value ]
Parameters
object
An object expression that evaluates to a PortController object.
value
An Int32 representing the baud rate of the communications port.
Return Value
An Int32 representing the baud rate of the port.
Remarks
Valid baud rates are as follows:
- 110
- 300
- 600
- 1200
- 2400
- 4800
- 9600 (Default)
- 14400
- 19200
- 28800
- 38400
- 56000
- 57600
- 115200
- 128000
- 256000
Default
9600
Errors
Attempting to set BaudRate to an invalid value
will cause PortController to throw an "Invalid argument" exception.
Example
[Visual Basic]
'Set baud rate
myPortController.BaudRate = 9600
'Get baud rate
Dim baudRate As Int32
baudRate = myPortController.BaudRate
[C#]
// Set baud rate
myPortController.BaudRate = 9600;
// Get baud rate
Int32 baudRate = myPortController.BaudRate;
[C++]
// Set baud rate
myPortController->BaudRate = 110;
// Get baud rate
Int32 baudRate = myPortController->BaudRate;
See Also
Parity property | DataBits property | StopBits property | Open method
|