beautypg.com

Remote Processing RPC-210 User Manual

Page 23

background image

SERIAL & SPI PORTS

BASIC

SECTION 4

Page 4-5

Line 20 sets up ON CO M$ to interrupt on a < CR> and
branch to line 1000. Line 30 sets up this card' s address.

Line 1010 checks to see if the rece ived mess age = this
card's address. If not, the subroutine ends. When there
is a match, further processing is performed.

USING RADIO MODEMS

Using radio modem s in a network is similar to using RS-
485 in a network. The only real difference is the modem
connects to the RPC -210 thro ugh the RS-2 32 serial po rt.

Some radio modem s use the CTS line to control the
transmitter. Others may require a separate TTL line.
One control line to consider the RS-485 transmitter
enable. This line is available at W6-1. When you need
to transmit, this line will go high when transmitting then
shut off. Depending upon the characteristics of your
transm itter, you may need a “ warm up” time befor e it is
stable. In this case, you may need to use one of the lines
from J7 to turn the transmitter on and off.

When u sing the RP C-210 in battery situa tions, power to
the modem may be switched on and off the ‘E’ power
terminal on P1. When the RPC -210 is powered on,
power is available to the modem. You control the actual
transmitter through a separate line.

ACCESSING SERIAL BUFFERS

Access CO M0 and C OM1 buffers in one of thre e ways:

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.

INPUT strips bit 7. This means ASCII characters
from 0 to 127 are rec eived.

2.

GET function. Char acters ar e rem oved one at a
time as an ASCII value. A 0 is returned when the
buffer is e mpty. Use the C OM function to
determine if the buffer is empty or if a 0 is an
ASCII value.

If you don' t read the b uffer an d the buffer fills, all

subsequent characters are discarded. GET m ay be
u s ed a ny w h er e in th e pr o g ra m .

3.

COM$(n) retrieves all characters in the buffer,
including other control codes (except CR).

ACCESSING COM0 AND COM1

The port INP UT and GE T functions retrieve data using
the UIn c omm and. UI0 r outes inputs to C OM 0 while
UI1 routes inputs to the COM1 port. PRINT outputs are
set by the U On com mand. UO0 p rints out C OM 0 while
UO1 outputs COM1. PRINT #1, is an alternative way
to print to COM 1.

The following show how UIn and U On work.

100

UI0

Set to COM0

110

INPUT A

Get data from COM0 port

520

UI1

Switch to COM1 port

530

INPUT B

Get data from COM1 port

800

REM Print to COM0

810

PRINT "Temperature:",T

900

REM Print to COM1

910

PRINT #1, "Set pressure

at:",CA

Power up default is set to COM 0.

DISABLING CONTROL-C

Program execution is terminated by entering a
< Cntl> < C> . To disable < Cntl> < C> so program
execution is not terminated, execute the following
statemen t:

DBY(38) = DBY(38) .OR. 1