Command Descriptions
159
[ IN ]
Input Status
Type
Assignment or Comparison
Syntax
See
below
Units
n/a
Range
n/a
Default
n/a
Response
n/a
See Also
GOWHEN, IN, INFNC, [ LIM ], ONIN, TIN, VARB
Product Rev
GT6K 6.0
GV6K 6.0
Use the
IN
operator to assign the input value to a binary variable (
VARB
), or to make a comparison against a
binary or hexadecimal value. To make a comparison against a binary value, the letter b (b or B) must be
placed in front of the value. The binary value itself must only contain ones, zeros, or Xs (1, Ø, X, x). To make
a comparison against a hexadecimal value, the letter h (h or H) must be placed in front of the value. The
hexadecimal value itself must only contain the letters A through F, or the numbers Ø through 9.
Syntax:
VARBn=<B>IN
where “
n
” is the binary variable number and “
<B>
” is the number of the I/O brick
where the input resides (not required if addressing inputs on the Gem6K’s
DRIVE I/O
connector),
or
IN
can be used in an expression such as
IF(2IN=b11Ø1)
, or
IF(2IN=h7F)
. To assign only
one input value to a binary variable, instead of all the inputs, the bit select (
.
) operator can be
used. For example,
VARB1=2IN.10
assigns the binary state of input 10 (2
nd
pin on SIM 2) on I/O
brick 2 to binary variable 1.
The function of the inputs is established with the
INFNC
command (although the
IN
operator looks at any
trigger or external digital input, regardless of its assigned function from the
INFNC
command).
Example:
VARB1=3IN
; Input status on I/O brick 3 assigned to binary variable 1
VARB2=2IN.12
; Input bit 12 on I/O brick 2 assigned to binary variable 2
VARB2
; Response if bit 12 is set to 1:
;
*VARB2=XXXX_XXXX_XXX1_XXXX_XXXX_XXXX_XXXX_XXXX
IF(1IN=b111011X11) ; If the input status contains 1's for inputs 1,2,3,5,6,8,& 9,
; and 0 for input 4 on I/O brick 1, do the commands
; following the IF statement
TREV
; Transfer revision level
NIF
; End IF statement
IF(2IN=hEF00)
; If the input status contains 1's for I/O brick 2's inputs
; 1,2,3,5,6,7,& 8, and 0's for every other input, do the
; commands following the IF statement
TREV
; Transfer revision level
NIF
; End IF statement
www.comoso.com
Summary of Contents for Gemini GV6K
Page 24: ...www comoso com...
Page 40: ...www comoso com...
Page 344: ...www comoso com...
Page 350: ...www comoso com...