Remote-processing RPC-210 Manuel d'utilisateur Page 23

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 60
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 22
SERIAL & SPI PORTS BASIC SECTION 4
Page 4-5
Line 20 sets up ON COM$ 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 received message = this
card's address. If not, the subroutine ends. When there
is a match, further processing is performed.
USING RADIO MODEMS
Using radio modems in a network is similar to using RS-
485 in a network. The only real difference is the modem
connects to the RPC -210 through 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
transmitter, 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 using the RPC-210 in battery situations, 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 three ways:
1. INPUT statement. 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. This means ASCII characters
from 0 to 127 are received.
2. GET function. Characters ar e rem oved one at a
time as an ASCII value. A 0 is returned when the
buffer is empty. 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 buffer and the buffer fills, all
subsequent characters are discarded. GET m ay be
used anywhere in the program.
3. COM$(n) retrieves all characters in the buffer,
including other control codes (except CR).
ACCESSING COM0 AND COM1
The port INPUT and GE T functions retrieve data using
the UIn command. UI0 routes inputs to C OM0 while
UI1 routes inputs to the COM1 port. PRINT outputs are
set by the UOn com mand. UO0 p rints out C OM0 while
UO1 outputs COM1. PRINT #1, is an alternative way
to print to COM 1.
The following show how UIn and UOn 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 COM0.
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
statement:
DBY(38) = DBY(38) .OR. 1
Vue de la page 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 59 60

Commentaires sur ces manuels

Pas de commentaire