44
Gemini GV6K/GT6K Command Reference
linked with an
AND
command, then the whole statement is true. This fact is best illustrated by example.
Example 1:
IF(VAR1>Ø
AND
VAR2<3)
:
TPME
:
NIF
If variable 1 = 1 and variable 2 = 1, then the expression within the
IF
statement is true, and
the commands between the
IF
and the
NIF
will be executed.
Example 2:
WHILE(VAR1=1
AND
VAR2=2)
:
TPME
:
NWHILE
If variable 1 = 1 and variable 2 = 1, then the expression within the
WHILE
statement is false,
and the commands between the
WHILE
and the
NWHILE
will not be executed.
To evaluate an expression (Expression 1
AND
Expression 2 = Result) to determine if the whole expression
is true, use the following rules:
TRUE
AND
TRUE = TRUE
TRUE
AND
FALSE = FALSE
FALSE
AND
TRUE = FALSE
FALSE
AND
FALSE = FALSE
[ ANI ]
Analog Input Value
Type
Assignment
or
comparison
Syntax
See
below
Units
n/a
Range
n/a
Default
n/a
Response
n/a
See Also
ANIRNG,
TANI
Product Rev
GT6K 6.0
GV6K 6.0
Use the
ANI
operator to assign the voltage level present at an analog input (ANI) to a variable, or to make a
comparison against another value. The ANI value is measured in volts.
The
ANI
value is derived from the voltage applied to the corresponding analog input and ground. The analog
value is determined from a 12-bit analog-to-digital converter. Under the default ANI voltage range, set with
ANIRNG
, the range of the
ANI
operator is -10.000VDC to +10.000VDC (see
ANIRNG
command for optional
voltage ranges).
Syntax:
VARn=<B>ANI.i
where “
n
” is the variable number, “
<B>
” is the number of the I/O brick, and
“
i
” is the I/O brick address where the analog input resides; or
ANI
can be used in an expression
such as
IF(1ANI.2=2.3)
. If no brick identifier (
<B>
) is provided, it defaults to brick “0”, the
onboard analog input. To understand the I/O brick addressing convention, refer to page
8
.
Example:
VAR1=ANI.1
; Voltage value at onboard analog input is assigned
; to variable 1
VAR2=3ANI.2
; Voltage value at analog input 2 on I/O brick 3 is assigned
; to variable 2
IF(1ANI.1<8.2)
; If voltage value at analog input 1 on brick 1 < 8.2V, do the
; commands between the IF statement and the NIF statement.
TREV
; Transfer revision level
NIF
; End if statement
www.comoso.com
Содержание Gemini GT6K
Страница 24: ...www comoso com ...
Страница 40: ...www comoso com ...
Страница 344: ...www comoso com ...
Страница 350: ...www comoso com ...