
332
Gemini GV6K/GT6K Command Reference
Binary variables are also used in conjunction with bitwise operators (
&
,
|
,
^
, and
~
).
Example
:
VARB1=VARB2
|
VARB3
&
b1111ØØØØ11ØØ1
The expression must be less than 80 characters in length, including the (
VARB1=b
or
VARB1=h
) part of the
expression.
NOTE
: When assigning a binary variable, any bit set to “
x
” remains “
x
” until set to “
1
” or “
0
”. Any bit
that is unspecified is set to “
x
”.
All binary variables can be used to set bits for commands that require at least 4 bits of binary information.
For example, the
OUT
command requires more than 4 bits of binary information; therefore, the command
OUT(VARB1)
is legal.
Rule of Thumb for command value substitutions: If the command syntax shows that the command field
requires a binary value (denoted by
<b>
), you can use the
VARB
substitution.
Example
:
VARB1=b1110 & hA
; Binary variable 1 is set to binary 1110 bitwise
; "AND"ed with hexadecimal A
VARB1=IN.7
; State of onboard input bit 7 assigned to binary variable 1
OUT(VARB2)
; State of all onboard outputs assigned by binary variable 2
VARCLR
Variable Clear
Type
Variable
Syntax
<a_><!>VARCLR
Units
n/a
Range
n/a
Default
n/a
Response
n/a
See Also
DVAR, DVARI, DVARB, VAR, VARB, VARI, VARS
Product Rev
GT6K 6.0
GV6K 6.0
VARCLR
resets all numeric variables (
VAR
), integer variables (
VARI
), binary variables (
VARB
), and string
variables (
VARS
) to their factory default values:
Numeric (
VAR
) variables are set to
0.0
Integer (
VARI
) variables are set to
0
Binary (
VARB
) variables are set to
bxxxx_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx
String (
VARS
) variables are set to
""
VARI
Integer Variable Assignment
Type
Variable
Syntax
<a_><!>VARI<i><=i>
Units
1
st
i = variable number
2
nd
i = integer number
Range
1
st
i = 1-225
2
nd
i = -2,147,483,647 to +2,147,483,647
Default
n/a
Response
VARI1: *VARI1=+Ø
See Also
DVARI, INVARI, VARB, VAR, VARCLR, VCVT, WRVARI
Product Rev
GT6K 6.0
GV6K 6.0
Integer variables can be used to store integer number values, with a range from -2,147,483,647 to
+2,147,483,647. The information is assigned to the variable with the equal sign (e.g.,
VARI1=32
).
All variables (numeric [
VAR
], binary [
VARB
], integer [
VARI
], and string [
VARS
]) are automatically stored in
battery-backed RAM.
Integer variables can be used with mathematical (
=
,
+
,
-
,
*
,
/
) and bitwise operators (
&
,
|
,
^
,
~
). For example,
VARI1=(3+4-7*4/4+3-2/2)*3
. Numeric (
VAR
) and integer (
VARI
) variables can be mixed in the
www.comoso.com
Содержание Gemini GT6K
Страница 24: ...www comoso com ...
Страница 40: ...www comoso com ...
Страница 344: ...www comoso com ...
Страница 350: ...www comoso com ...