OPEN comspec$ AS [#]fnbr
Will open a serial port for reading and writing. Two ports are available (COM1: and COM2:) and both can be open simultaneously.
‘comspec$’ is the serial port specification and has the form:
“COMn: baud, buf, int, intlevel” with an optional “,FC” and/or “,OC” appended.
COM1: uses pin 15 for receive data and pin 16 for transmit data and if flow control is specified pin 17 for RTS and pin 18 for CTS.
COM2: uses pin 19 for receive data and pin 20 for transmit data on the CGMMSTICK and D0 (receive) and D1 (transmit) on the CGCOLORMAX.
If the port is opened using ‘fnbr’ the port can be written to and read from using any commands or functions that use a file number.
See also:
CLOSE
CLOSE CONSOLE
INPUT$
LOC
LOF
OPEN AS COLSOLE
SETPIN
Leave a Reply