Chapter
10
I
BASIC Ke.ywords
OPE
N/C
ommunications Statement
OPEN
“COMchan~l: [speed] [,purity1 [,datul[,stopl
[,RSI[,CS[secondsl][,DS[secondslj[,CD[seconds]
j[,m&]
[,PEl
[,LFl”
AS
[#lbuffer[LEN
=
number]
Opens a file and allocates a buffer for RS-232C (Asynchronous
Communications Adapter) communication.
Channel
can be
1
or
2
to
select the communications channel
to
be opened.
Speed
is
an integer specifying the transmit and receive rate in
bits per second (bps). Valid speeds are
75,
110, 150, 300, 600,
1200, 2400, 4800, and 9600.
If
you omit
speed,
BASIC sets the
speed
at
300 bps.
Parity
is a constant specifying the parity
to
be used when the
data is transmitted and received. The constant must be one of
the following:
E
0
M
S
N
EVEN transmit parity, EVEN receive parity
checking.
ODD
transmit parity,
ODD
receive parity
checking.
parity bit always transmitted and received
as
a
mark
(1
bit).
parity bit always transmitted and received as a
space (0 bit).
no transmit parity, no receive parity checking.
If you omit
parity,
BASIC assumes E (EVEN).
Data
is an integer specifying the number of transmit and re-
ceive bits. Valid values are
5,
6,
7,
and 8.
If
you do not specify
data,
BASIC assumes
7.
Note:
Eight data bits
with
parity is illegal.
Stop
must be either
1
or
2
to
indicate the number
of
stop bits. If
you omit
stop,
75
and 110 bps transmit
2
stop
bits, and all other
speeds transmit
1
stop
bit.
244