Output
Outputs/Sends data (Places bytes into the transmit buffer)
Not available at design time. Write only at runtime.
MSComm32 and Comm64 have similar but not identical behavior (See remarks below)
 |
| |
Syntax |
object.Output = value |
| |
|
|
| |
object |
Name of the communications control. |
| |
value |
A String expression containing the characters/bytes to place into the transmit buffer. |
| |
|
|
| |
Example. |
|
| |
|
object.Output = Text1.Text |
'// Places the contents of a text box
'// into the transmit buffer. |
| |
|
|
|
|
 |
Remarks:
If you attempt to insert too much data into the transmit buffer the data will be truncated. This property does not return an error - but an OnComm comEventTxFull is fired.
The .Output function can only be used to send string data. if you wish to send an array of bytes then use the writeBytes( ) function.
MSComm32
Under some circumstances (depending on the state of flow control and/or underlying comTimeOuts in the Windows com driver) calls to the Output property may not return quickly causing the application to appear to hang momentarily making the application feel a little unresponsive. (worst case scenario is that the application locks up for lengthy periods or even hangs forever) Under some flow control conditions the MSComm control may discard bytes/lose data.
Comm32
Comm64 is a multithreaded component isolating the application from the underlying com driver. Depending on the value of the TxTimeout property calls to the Output property return quickly and your application remains responsive.
If TxTimeout is 0 (zero) then the Output function returns immediately while data is transmitted in a background thread and you can be notified via the OnComm event once the transmission is complete.
We would suggest not using TxTimeout values above 0 with this simple Output function. You should consider using the writeString and writeBytes functions instead.
|