count = WriteSerialData(id, data$[, timeout])
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.