TxTimeout
Sets a transmit timeout.
Available at design time and runtime. Can not be changed while the port is open.
Under default conditions this property has no effect (See Remarks below)
Only available with Comm32. Not available with MSComm32
 |
| |
Syntax |
object.TxTimeout = value |
| |
|
|
| |
object |
Name of the communications control. |
| |
|
|
| |
value |
A numerical value in the range 0 to 32000 Measured in ms (1000 = 1 seconds) |
| |
|
|
| |
Example |
object.TxTimeout = 500 |
'// Set the TxTimeouts to 500ms |
| |
|
|
'// Output functions will return after 500ms
'//
even if all tx data was not sucessfully transitted. |
| |
|
|
|
|
 |
Remarks:
If TxTimeout is 0 (zero) then all Output/write properties/functions return immediately allowing you application to carry on while the data is transmitted in a separate thread. You can be notified via the OnComm even when the transmsiion is complete.
If TxTimeout is greater than zero then Output/write functions will not return until the required number of bytes have been transmitted or when TxTimeout occurs.
If using TxTimeouts we would suggest using a very small timeout value and using the writeString or writeBytes functions because they return a value indicating the number of chars/bytes that were sent allowing you to retry with any remaining chars/bytes.
|