Remote-processing RPC-150 Manuale Utente Pagina 12

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 26
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 11
SERIAL PORTS CHAPTER 4
Page 10 RPC-150
Figure 4-1 Serial ports
DESCRIPTION
The RPC -150 has two serial ports that can be used for
interfacing to a printer, terminal, RS-485 network, or
other ser ial devices. This chapte r descr ibes their
characteristics and how to use them. Frequent
references are m ade to commands listed in the
CAMBA SIC Programming Manual. P lease ref er to this
manual for more 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 purpose
port and can be used as either RS-232 or RS-422/485.
Both ports support XO N/XOF F protocol to contr ol data
transmission. Each por t has a 256 character interrupt
driven input and output buffer. This allows charac ters to
be sent out (using PRINT) without slowing down
program execution. However, 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 characters have been received, excess
ones are ignored.
The baud rate, parity, data length, and stop bit length are
changed using the CONFIG 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 devices to the port. The cable consists of a 10 pin
IDC connector wired to a DB-9 connector. T he
connector plugs directly into a 9 pin serial port connector
on a PC.
This port is normally used for program ming. D uring
run time it may be used as a general purpose seria l port.
When used for programming or with the INPUT
statement, it will accept ASCII character values from 0
to 127. When used with the INKEY$ and COM$
functions, it will return ASCII values from 0 to 255.
COM2 SERIAL PORT
COM2 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 hardware handshaking lines,
CTS and RTS. W hen RTS goes low, the RPC -150 is
held off from transmitting out C OM2. 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, transmission is held off.
The CTS line may be set high or low to hold off
comm unication. Line 400 sets CTS low and 500 sets it
high.
400 BIT 128,4,1
500 BIT 128,4,0
The CONFIG BAUD statement sets the configuration of
this port.
ACCESSING SERIAL BUFFERS
You can access C OM1 and COM 2 buffers in three w ays:
1. INPUT sta tement. This removes all characters in
the buffer up to the term inator cha racter and puts
them into a variable.
When using the INPUT statement, program
execution is suspended until a < cr> (Enter key) is
received. W hether this is a problem depends on
your particular application.
INPUT strips bit 7 on the COM1 port. This means
ASCII characters from 0 to 127 are received. The
INPUT statement can return a maximum string
length of 150 character s.
2. INKEY$(n) function. Characters are removed one
at a time. A null string is returned when the buffer
is empty.
Vedere la pagina 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 25 26

Commenti su questo manuale

Nessun commento