'KCMLWritePortName(sPort$, pData$, iCount)
Open, write data to and close a serial or parallel port on the client.
Arguments
| STR() | sPort$ | [in] | Format string describing the port to be opened. |
| DIM() | pData$ | [in] | The data to be written. |
| INT() | iCount | [in] | The number of bytes to be written. |
Returns
The number of bytes written. This can be less than the number requested.
Syntax
The following definition is built into KCML. You do not have to include it in your own code.
$DECLARE 'KCMLWritePortName(STR(), DIM(), INT())
Remarks
KCMLWritePortName opens, writes to and then closes a serial or parallel port on the client. It is equivalent to calling KCMLOpenPort, KCMLWritePort and KCMLClosePort. This function can be useful if only a small amount of data needs to be written.
Example
$DECLARE 'KCMLWritePortName(STR(),DIM(),INT())
DIM Data$256
DIM BytesWritten
Data$ = "Some Data"
REM Write to COM2 at 9600 baud, 8 bits per character, no parity, one stop bit and hardware flow control
BytesWritten = 'KCMLWritePortName("COM2:9600,8,N,1,H", Data$, LEN(Data$))
Further Information
| Introduced | KCML 6.20 |
| Compatibility | KClient |
See Also
KCMLClosePort, KCMLDebugBackProcess, KCMLGetClientIP_TOS, KCMLOpenPort, KCMLReadPort, KCMLSetClientIP_TOS, KCMLWritePort