BaudRate Property
Sets and returns the baud rate communications parameter.
Syntax
Visual Basic
object.BaudRate [ = value ]
Visual C++
object.GetBaudRate()
object.SetBaudRate(value)
Delphi
object.BaudRate [ := value ]
| Part
| Description |
| object |
An object expression that evaluates to a PortController object. |
| value |
An integer representing the baud rate of the communications port.
|
Example
Visual Basic
'Set baud rate
myPortController.BaudRate = 9600
'Get baud rate
Dim baudRate As Integer
baudRate = myPortController.BaudRate
Visual C++
// Set baud rate
m_myPortController.SetBaudRate(9600);
// Get baud rate
long lBaudRate = m_myPortController.GetBaudRate();
Delphi
// Set baud rate
myPortController.BaudRate := 9600;
// Get baud rate
var baudRate: Integer; // declare variable in the proper place
baudRate := myPortController.BaudRate;
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
Returns
An integer representing the baud rate of the port.
Errors
Attempting to set BaudRate to an invalid value
will cause the PortController to throw an "Invalid argument" exception.
See Also
Parity, DataBits, StopBits, Open()
|