![Galil Motion Control RIO-47 series
RIO-47100 Скачать руководство пользователя страница 78](http://html1.mh-extra.com/html/galil-motion-control/rio-47-series-rio-47100/rio-47-series-rio-47100_user-manual_558776078.webp)
Instruction
Interpretation
OB1,POS
Set Output 1 if the variable POS is non-zero. Clear Output 1 if POS
equals 0.
OB2,@IN [1]
Set Output 2 if Input 1 is high. If Input 1 is low, clear Output 2.
OB3,@IN[1]&@IN[2]
Set Output 3 only if Input 1 and Input 2 are high.
OB2,COUNT [1]
Set Output 2 if element 1 in array COUNT is non-zero.
The output port can be set by specifying the OP (Output Port) command. This instruction allows a
single command to define the state of the entire output bank, where 20 is bit 0, 21 is bit 1 and so on.
A 1 designates that the output is on.
For example:
Instruction
Interpretation
OP6
Sets bits 1 and 2 of bank 0 high. All other bits on bank 0 are 0. (21 + 22 = 6)
OP0,0
Clears all bits of bank 0 and 1
OP0,7
Sets output bits 0, 1 and 2 to one (20 + 21 + 22 ) on bank 1. Clears all bits on bank
0.
The state of the digital outputs can be accessed with the @OUT[n] where n is the output number (Ex:
MG@OUT[1] displays the state of output number 1).
Digital Inputs
The digital inputs are accessed by using the @IN[n] function or the TI n command. The @IN[n]
function returns the logic level of a specified input, n, where ‘n’ is the input bit number. The IQ
command determines the active level of each input. The TI n command gives the input status of an
entire bank, where ‘n’ is the bank number, 0 or 1. The AI command is a trippoint that pauses
program execution until the specified combination of inputs is high or low.
Example – Using Inputs to control program flow
Instruction
Instruction
JP #A,@IN[1]=0
Jump to A if input 1 is low
MG@IN[2]
Display the state of input 2
AI 7&-6
Wait until input 7 is high and input 6 is low
Analog Inputs
Analog inputs are accessed with the @AN[n] function where n is the number assigned to the analog
input channel. The returned value will be a voltage reading with 12 bit resolution (16-bit optional for
RIO's with the ±10V configurable option). The voltage input range is configurable on ±10V
configurable options using the AQ command.
Note: When analog input values are accessed from the Data Record or from the Record Array
function, the returned value will be an integer number that represents the analog voltage. For a 0-5V
analog input options, the equation used to determine the decimal equivalent of the analog voltage is
as follows:
N= (((V-Vlo)*4095)/(Vhi-Vlo))*8
Where N is the integer equivalent of the analog voltage, V is the expected analog voltage, Vlo is the
lowest voltage in the total range (0V for the standard analog input module) and Vhi is the highest
voltage in the total range (5V for the standard module). The data range for N is 0-32760.
Chapter 5 Programming ▫ 78 RIO-47xxx Rev. 1.0r