
DIGITAL LINES BASIC SECTION 6
Page 6-3
J3 Port group Address
A - Digital I/O & display (J4) 0A200H
B - Digital I/O 0A201H
C - Digital I/O 0A202H
82C55 configuration 0A203H
The 82C55 configuration register is accessed when using
the CONFIG LIN E 100 statem ent.
Many times you only need to know or set the status of a
single line. RPBASIC-52 has two core commands, one
each for input and output. The two commands are:
LINE and L INE#.
LINE accesses an individual line based on its position in
a MPS-8, -16, or -24 opto rack.
LINE# accesses an individual 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 access.
See examples below.
Both LINE commands still require that a CONFIG LINE
statement be executed (unless all lines are inputs).
LINE and L INE# are available as a com mand (output 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
Turns the module in opto rack position 13 ON. 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 returned.
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 change in status, a softwar e interrupt 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 COUNT 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 from a high to a low, the count is
incremented. If the current count equals that set by ON
COUNT, a software interrupt is flagged and the routine
at line 6000 will be executed.
ON COUNT has a number of possibilities. Refer to the
RPBASIC-52 Programming Manual under ON COUNT
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 COUNT, 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
Commentaires sur ces manuels