Name
WriteSerialData -- write data to serial port connection (V8.0)
Synopsis
count = WriteSerialData(id, data$[, timeout])
Function
This command can be used to write the data specified in data$ to the serial port connection specified in id. The serial port connection must have been opened using OpenSerialPort() before. Additionally, you can pass a duration in milliseconds in the timeout argument to set a timeout for the write operation. If the timeout parameter is specified, WriteSerialData() will never block for longer than the specified duration.

WriteSerialData() returns the number of bytes written to the serial port. Note that this can be less than the bytes in data$. If only parts of data$ have been sent to the serial port, you need to call WriteSerialData() again to send the rest.

Inputs
id
identifier of the serial port connection to use
data$
the data to write to the serial port
timeout
optional: number of milliseconds after which to abort the operation (defaults to 0 which means to block forever until data can be sent)
Results
count
number of bytes successfully written
Example
See OpenSerialPort


Show TOC