To allocate a buffer to support RS-232 asynchronous communications with other computers and peripheral devices in the same manner as OPEN for disk files.
OPEN "COM[n]:[speed][,parity][,data] [,stop][,RS][,CS[n]][,DS[n]][,CD[n]][,LF] [,PE]" AS [#]filenum [LEN=number]
COM[n] is a valid communications device: com1: or com2:.
speedis a literal integer specifying the transmit/receive baud rate. Valid speeds are as follows: 75, 110, 150, 300, 600, 1200, 1800, 2400, 4800, and 9600. The default is 300 bps.
parityis a one-character literal specifying the parity for transmitting and receiving. Valid characters specifying parity are as follows:
Parity bit always transmitted and received as space (0 bit).
Parity bit always transmitted and received as mark (1 bit).
Odd transmit parity; odd receive parity checking. Default is even.
Even transmit parity; even receive parity checking. Even is default.
No transmit parity. No receive parity checking.
datais a literal integer indicating number of transmit/receive data bits. Valid values for the number of data bits are 4, 5, 6, 7, or 8, the default is 7 bits.
Four data bits with no parity is illegal; eight data bits with any parity is illegal.
stopis a literal integer expression returning a valid file number. Valid values for number of stop bits are 1 and 2. If omitted, 75 and 110 bps transmit two stop bits. All others transmit one stop bit.
filenumis a number between 1 and the maximum number of files allowed. A communications device may be opened to only one file number at a time. The filenumis associated with the file for as long as the file is open, and is used to refer other COM I/O statements to the file. Any coding errors within the filename string result in "Bad file name" errors. An indication as to which parameters are in error is not given.
numberis the maximum number of bytes which can be read from the communications buffer when using GET or PUT default of 128 bytes.
A "Device timeout" error occurs if "data set ready" (DSR) is not detected.
The RS, CS, DS, DC, LF, and PE options affect the line signals as follows:
suppresses RTS (request to send)
controls CTS (clear to send)
controls DSR (data set ready)
controls CD (carrier detect)
sends a line feed at each return
enables parity checking
n is the number of milliseconds to wait (0-65535) for that signal before a device timeout error occurs. Defaults are: CS1000, DS1000, and CD0. If RS was specified then CS0 is the default. If n is omitted, then timeout is set to 0.
In the following, File 1 is opened for communications with all defaults: speed at 300 bps, even parity, seven data bits, and one stop bit.
10 OPEN "COM1:" AS 1
In the following, File 2 is opened for communications at 2400 bps. Parity and number of data bits are defaulted.
20 OPEN "COM1:2400" AS #2
In the following, File 1 is opened for asynchronous I/O at 1200 bits/second. No parity is to be produced or checked.
All Frank Sinatra recordings, All Beatles albums, All solo albums from John Lennon, Paul McCartney, George Harrison and Ringo Starr, All Beatles songs, List of Platinum selling albums, Database with hits from 1950 to 1999.
Sought after DLL files, Nutworks magazine (retro), Worldwide ISO and TLD codes, File extensions database, The Hackers dictionary, Free software for the Atari, Amiga and Macintosh, Nokia smartphone, PocketPC, List of all BASIC programming language commands, List of all DOS commands, Free Advanced Bash-Scripting Guide (Linux-Unix)