@SERIALPORTOPEN[COMn[, baud[, parity[, bits[, stopbits[, flow]]]]]] - Open a serial port for read & write. The parameters are:

 

COMn - The COM port to open (COM1 - COM9)

 

baud - The baud rate (110 - 256000)

 

parity - The parity scheme to use. This can be one of the following values:

no

odd

even

mark

space

 

bits - The number of bits in the bytes to transmit & receive

 

stopbits - The number of stop bits to be used. This can be one of the following values:

 

1

1.5

2

 

flow - The type of flow control to use. This can be one of the following values:

no

CtsRts

CtsDtr

DsrRts

DsrDtr

XonXoff

 

@SERIALPORTOPEN returns a handle to the serial port, which must be passed to the other serial port functions.

 

See also: @SERIALPORTCLOSE, @SERIALPORTFLUSH, @SERIALPORTREAD, @SERIALPORTWRITE.

 

Example:

 

set port=%@serialportopen[com1,9600]

set string=%@serialportread[%port]

echo %@serialportwrite[%port,Goodbye!"

echo %@serialportflush[%port]

echo %@serialportclose[%port]