Remote-processing RPC-52 Manuel d'utilisateur Page 19

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 36
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 18
CHAPTER 6 DIGITAL AND OPTO PORTS
Page 17
using the PW M statem ent.
Jumper s W6 and W7 set the P WM output for opto
positions 0 and 1.
Jumper Position Description
W6 [1-2] Position 0 normal mode
W6 [2-3] Position 0 PWM output
W7 [1-2] Position 1 normal mode
W7 [2-3] Position 1 PWM output
When either position is jumpered for PWM output, none
of the LINE commands will work for that position.
PWM outputs are used to gener ate analog outputs.
When using one of the PWM positions, the
corresponding analog output should not be used.
G5 operation
The G5MOD statement can refer to an input or output
module, depending upon how it was used. Its use as an
input is discussed fir st.
Values from G5 modules are returned using the G5MOD
function. The syntax is
A = G5MOD(slot)
The slot number is from 0 to 3 or 100 to 123,
corresponding to the position on or off the boar d. T his
function returns a number from 0 to 256, corr esponding
to a resolution of 8 bits. The G5M OD function takes
about 7 ms to convert the input data.
WARNING:
Conversion time is approximately 7 m s. D uring this
time, all interrupts are turned off. Serial characters
will be missed at baud rates at and above 9600.
When installing and operating a G5 module in a
particular slot, make sure it is not turned "ON" as for a
G4 digital output module. If an output is turned on, then
no reading is received. When executing the CONFIG
LINE 0 statem ent, the slot the G5 m odule goes into
should be set as an input (1).
The program below takes 100 samples and stores it in an
array. The time to read and store 100 samples is 0.7
seconds, or 7 ms per sample.
10 DIM G(100)
20 FOR X = 0 TO 99
30 G(X) = G5MOD(1)
40 NEXT
Some applications require that measurements be made at
fixed intervals. T he ONTICK construct can be used to
take samples at timed intervals. The program below
reads 2 channels every tenth of a second and stores it
into an array. When the array fills, the tick timer stops.
10 DIM G(100)
20 DIM H(100)
30 ONTICK .1,100
40 REM This is a dummy loop
50 GOTO 40
100 G(I) = G5MOD(0)
110 H(I) = G5MOD(1)
120 PRINT I,G(I),H(I)
120 I=I+1
130 IF I=100 THEN ONTICK 0,100
140 RETI
The G5MOD statement also outputs to a module on an
external opto rack. It is not possible to use the internal
opto rack due to the electrical driver required. The
output number is from 0 to 4095.
To output to a G5 module, execute the following
command:
1000 G5MOD channel,value
channel is from 100 to 123 and corresponds to the
external opto rack position. value ranges fr om 0 to
4095.
Converting analog measureme nts
Input readings are converted to usable units of
measurement by performing scaling calculations in the
program. The G5MOD function returns values from 0
to 255. To change these readings to other units, use the
following calculation:
variable = K * G5MOD(slot)
K is a scaling constant. It is obtained by diving the
highest measurement unit number by 256.
Example:
You want to measure a 0 to 200 PSI pressure
transducer with a 0 to 5 volt output. Divide 200 by
256 to obtain the value of K.
K = 200 / 256
K = .78125
To obtain the final value for the equation in PSI:
100 V= .78125 * G5M OD(n)
DIGITAL I/O PORT
Digital I/O lines on the RPC-52 go to connector J4. I/O
interface is through an 82C55 chip.
This port can be used to interface additional opto
modules (using the MPS ser ies racks) , dr ive small
relays, solenoids, motors, or lamps, and provide general
purpose TTL I/O to other logic devices or mechanical
switches. The LINE command is used to access and
control this port.
The lines on J4 are divided into 3 eight bit gr oups. Ports
A and B can be configured as all inputs or outputs. Port
C can be progr amed a s one group of 8 inputs or outputs
or as two groups of four lines (upper and lower C ). The
four lines in upper and lower C can each be programmed
Vue de la page 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 35 36

Commentaires sur ces manuels

Pas de commentaire