Settings
Sets or Retrieves the Baud Rate. Parity, Databits and StopBit parameters.
Available at Design time and Runtime.
MSComm32 and Comm64 have Compatible Behavior.
 |
| |
Syntax |
object.Settings = value |
| |
|
|
| |
object |
Name of the communications control. |
| |
value |
A String expression containing the parameters in this order "Baud,Parity,Databits,StopBits" |
| |
|
|
| |
Example |
object.Settings = "9600,n,8,1" |
|
| |
|
|
|
| |
|
Text1.Text = object.Settings |
'// Retrieves the current parameters. |
| |
|
|
|
|
 |
Remarks:
Baud can be any numerical value above zero but expect a runtime error from your comport driver when you open the port with a baudrate that is not supported by your hardware. Recommended values are:-
110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200 (See below)
Parity can be one of the following standard parity values:
N, E or O (None, Even or Odd) Other values: M or S (Mark or Space) can also be used but may not be supported by all hardware.
The default is 'N' which will be used if you enter an invalid value.
DataBits can be one of the following standard values:
7 or 8 (Other values such as 5 or 6 can be used but may not be supported by all hardware)
The default is '8' which will be used if you enter an invalid value.
StopBits can be one of the following standard values:
1 or 2 (The StopBits setting of 1.5 can also be used but may not be supported by all hardware)
The default is '1' which will be used if you enter an invalid value.
Differences between MSComm32 and Comm64
Documentation from Microsoft is contradictory with regard to other baud rates such as: 14400, 56000, 128000, 256000 etc. This is due to differences in hardware. While most hardware will support the above standard baud rates; other hardware such as USB/RS232 cables, PCI cards and other add-on adapters can support many non-standard baud rates which might be rejected by MSComm32. We have therefore allowed you to enter any value above zero - but, as mentioned above, your comport device driver will fire a runtime error when you open the port if your hardware is not capable of the given baud rate.
|