Serial ports chapter 4 – Remote Processing RPC-2300 User Manual

Page 12

Advertising
background image

SERIAL PORTS

CHAPTER 4

Page 10

RPC-2300

Figure 4-1 Serial ports

DESCRIPTION

The SBS-2300 has two serial ports that can be used for
interfacing to a printer , ter minal, or other ser ial devices.
This chap ter descr ibes their ch aracter istics and how to
use them. F requent references ar e made to comma nds
listed in the CAMBA SIC II Programming Manual .
Please refer to this manual for mor e information.

Serial por ts are num bered C OM 1 and CO M2. COM 1 is
used for program development. During run time, it can
be used for other functions. C OM2 is a general purp ose
RS-232 po rt.

Both ports sup port XO N/ XOF F pr otocol to contr ol data
transmission. Each por t has a 256 character interrupt
driven inp ut and output bu ffer. This allow s charac ters to
be sent out (using PRINT) without slowing down
program execution. Howeve r, if the PRINT buffer fills,
program execution is suspended until the buffer em pties.
Both ports have a 256 character input buffer. When
more than 256 character s have been rece ived, exc ess
ones are ignored.

The baud rate, parity, data length, and stop bit length are
changed using the CONF IG BAUD command.

COM1 SERIAL PORT

COM 1 is J1 and is called the Console port on the card.
This port uses a VTC-10 serial cable to connect external
serial dev ices to the por t. T he cable con sists of a 10 pin
IDC connector w ired to a DB-9 connector. T he
connector plugs directly into a 9 pin serial port connector
o n a P C .

This port is normally used for program ming. D uring
run tim e it may be u sed as a gene ral pur pose seria l port.
W h e n u s ed f or p r og r a m mi ng o r w i th th e IN P U T
s ta t em e n t, i t wi ll ac c ep t A S C II c ha r a ct e r v a lu e s f r om 0
to 127. When used with the INKEY$ and COM$
functions, it will return ASCII values from 0 to 255.

COM2 SERIAL PORT

COM 2 is an RS-232 port. It also uses a VTC-10 serial
cable, described above. COM2 is identical to COM1
except that COM 2 has 2 hardw are handshaking lines,
CTS and RT S. W hen RT S goes low, the SBS-2300 is
held off fr om tra nsmitting out C OM 2. T he status of this
port is read by the BIT statement. The exam ple below
returns the status of the RTS line:

100 B = BIT(130,5)

If B = 1, transm ission is held off.

The CT S line may be set high or low to hold off
comm unication. Line 400 se ts CTS low and 50 0 sets it
high.

400 BIT 128,4,1
500 BIT 128,4,0

The CO NFIG BAUD statement sets both serial ports for
baud rate and data type.

ACCESSING SERIAL BUFFERS

You can access C OM1 and COM 2 buffers in three w ays:

1.

INP UT sta tement. This re moves a ll charac ters in
the buffer up to the term inator cha racter and puts
them into a variable.

When using the INPUT statement, program
execution is susp ended until a < cr> (Enter key) is
received. W hether this is a problem depends on
your particular application.

INPU T strips bit 7 on the COM1 por t. This means
ASCII character s from 0 to 127 are received. The
INPU T statement can return a maxim um string
length of about 150 chara cters.

2.

INKEY$(n) function. Characters ar e removed one
at a time. A null string is returned when the buffer
is empty.

Advertising