Remote Processing RPC-210 User Manual
Page 31

DIGITAL LINES
BASIC
SECTION 6
Page 6-3
J3 Port group
Address
A - Digital I/O & display (J4)
0A200H
B - D i gi ta l I / O
0A201H
C - D ig it al I/ O
0A202H
82C55 configuration
0A203H
The 82C55 configuration register is accessed when using
the CO NF IG LIN E 100 statem ent.
Many times you only need to know or set the status of a
single line. RPBASIC-52 has two cor e commands, one
each for input and output. The two commands are:
LINE and L INE#.
LIN E acces ses an individua l line based on its pos ition in
a MPS-8, -16, or -24 opto rack.
LIN E# acce sses an individua l line based on its pin
number at J3 or STB-26 term inal board.
The J3 Opto-P in Out table below show the
correspondence between an opto channel number and
actual J3 pin number.
Both LINE commands require an offset (100 for LINE,
101 for LIN E#) to the actual line you want to acc ess.
See examples below.
B ot h L I N E co m m a nd s st il l r e q ui r e t ha t a C O N F IG L I N E
statement be executed (unless all lines are inputs).
LIN E and L INE # are av ailable as a com mand (o utput to
a line) or a function (return a value).
A = LINE(100)
Returns the status on an opto rack at position 0. A 1 or
a 0 is returned. This is the same as reading the line at
J3-13.
LINE 113,ON
Turn s the modu le in opto rac k position 13 O N. What is
really happening is the line at J3-22 is going low.
A = LINE#(101)
Returns the status at J3, pin 1. A 0 or 1 is retur ned.
LINE# 110,1
Sets the line at J3, pin 10 to a 1.
Note that the LIN E# statements w ill not allow you to use
102, as this is + 5V at J3.
ON LINE 2,103,5000
Sets up a multi-tasking routine to check opto rack
position 3 (or J3-17). ON LIN E causes the operating
system on the RPC-210 to check the line every 10 mSec.
If there is a c hange in status, a softwar e interr upt is
flagged and the routine at line 5000 will be executed.
Executing ON LINE can generate a number of extra
interrupts. If you are interested in detecting when a line
goes low, try using ON COU NT with a count value of 1.
ON COUNT 4,115,124,6000
Sets up another multi-tasking routine to count pulses at
opto rack position 15 (or J3-18). ON COUN T causes
the operating system to check the port every 10 mSec.
When a line goes fro m a high to a low, the count is
incremented. If the current count equals that set by ON
COU NT, a software interrupt is flagged and the routine
at line 6000 will be executed.
ON C OUN T has a number of possibilities. Refer to the
R P B AS I C -5 2 P ro g r am m i ng M a nu a l u n de r O N C O U N T
for more inform ation.
A = COUNT(11)
Returns the current count at software counter 11. The
software counter is the same as that set up using ON
COUNT.
Read the information at the front of this chapter under
“RP BASIC-52 Progr aming Manual difference” for
important information.
The program example 210_MULT.BAS shows how ON
COM, ONTICK, ON COUN T, ON KEYPAD, and ON
LINE w ork in this self running demo.
NOTE: The RPC -210 is capable of checking and
executing many subroutines simultaneously.
However , its computing power m ay prove
limiting in some circumstances. If you expect
to detect, say 20 line changes/second and
execute “long” subroutines, consider upgrading