Command Descriptions
331
All variables (numeric [
VAR
], integer [
VARI
], binary [
VARB
], and string [
VARS
]) are automatically stored in
battery-backed RAM.
Variables are also used in conjunction with mathematical (
=
,
+
,
-
,
*
,
/
,
SQRT
), trigonometric (
ATAN
,
COS
,
PI
,
SIN
,
TAN
), and bitwise operators (
&
,
|
,
^
,
~
). For example,
VAR1=(3+4-7*4/4+3-2/1.5)*3
.
Each variable expression must be less than 80 characters in length, including the
VAR1=
part of the
expression.
Numeric data can also be read into a variable, through the use of the
READ
,
DAT
, or
TW
commands (e.g.,
VAR1=READ1
).
All variables can be used within commands that require a real or integer value. For example, the
A
command requires real values for acceleration; therefore, the command
A(VAR1)
is legal. Indirect variable
assignments are also legal; (e.g.,
VAR(VAR1)=5
or
VAR(VAR2)=VAR(VAR4)
).
Rule of Thumb for command value substitutions: If the command syntax shows that the command field
requires a real number (denoted by
<r>
) or an integer value (denoted by
<i>
), you can use the
VAR
substitution.
Example:
VAR1=2*PI
; Set Variable 1 to 2 pi
D(VAR2)
; Set the distance value equal to variable 2
Indirect Variables
: Numeric variables can be used indirectly. Only one level of indirection is possible
(e.g.,
VAR(VAR(VARn))
is not a legal command). The example below shows how indirect variables are
used to clear 50 variables (from 1 to 50).
Example:
VAR51 = 1
; Set Variable 51 to 1
REPEAT
; Begin repeat/until loop
VAR(VAR51) = 0
; Clear variables (e.g., if VAR51 = 8,
; then VAR(VAR51)=0 is equivalent to VAR8=0)
VAR51 = VAR51 + 1
; Increment counter
UNTIL (VAR51 = 51)
; End repeat/until loop
VARB
Binary Variable Assignment
Type
Variable
Syntax
<a_><!>VARB<i><=bb...bbb> (32 bits)
bit select syntax: VARB<i>.<bit #>-<b>
Units
i = variable number
Range
i = 1-125
b = 0, 1, X, or x
Default
n/a
Response
VARB1: *VARB1=XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX
See Also
DVARB, PLCP, VAR, VARI, VARCLR, VARS, VCVT, WRVARB
Product Rev
GT6K 6.0
GV6K 6.0
Binary variables can be used to store any 32-bit or less binary value. The 32-bit binary value must be in the
form of 32 ones, zeros, or Xs. The information is assigned to the binary variable with the equal sign.
All variables (numeric [
VAR
], integer [
VARI
], binary [
VARB
], and string [
VARS
]) are automatically stored in
battery-backed RAM.
Example
:
VARB1=b1111ØØØØ1111XXXX1111ØØØØxxxx1111
Notice that the letter “
b
” is required. The “
b
” signifies binary:
1
’s,
Ø
’s, and
X
’s only.
Example
:
VARB1.14-1
This is a shortcut to change only the state of
VARB1
bit #14 to “
1
”.
Example
:
VARB1=h7F4356A3
Notice that the letter “
h
” is required. The “
h
” signifies hexadecimal: Ø-9, A-F only.
www.comoso.com
Содержание Gemini GV6K
Страница 24: ...www comoso com...
Страница 40: ...www comoso com...
Страница 344: ...www comoso com...
Страница 350: ...www comoso com...