Command Descriptions
35
positive
number
^
positive number
=
0
positive number
^
zero or a negative number
=
1
zero or negative number
^
positive number
=
1
zero or negative number
^
zero or negative number =
0
Example:
VAR1=5
^
-1
Result:
VAR1=1
For a bitwise exclusive OR (using
VARB
), the value on the left side of the
^
operator has each of its bits
exclusive
ORed
with the corresponding bit of the value on the right side of the operator. Each bit
comparison will be composed of 9 possible combinations:
1
^
1
=
0 X
^
X
=
X
1
^
0
=
1 1
^
X
=
X
0
^
1
=
1 X
^
1
=
X
0
^
0
=
0 0
^
X
=
X
X
^
0
=
X
Example:
VARB1=b0000
1111
XXX1
^
b10XX
10XX
10XX
Response to
VARB1
is
*VARB1=10XX_01XX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX
Example:
VARB1=h32FD
^
h6A
Response to
VARB1
is
*VARB1=1010_0001_1111_1011_0000_0000_0000_0000
Example:
VARB1=h7FFF
^
b1101
1111
0000
1101
Response to
VARB1
is
*VARB1=0011_0000_1111_0010_XXXX_XXXX_XXXX_XXXX
The total command length must be less than 80 characters. The order of precedence is
left to right
. The
Operation Priority Level (
()
) operators can be used; however, they cannot be nested.
[ ~() ]
Boolean Not
Type
Operator
(Bitwise)
Syntax
See
Below
Units
n/a
Range
n/a
Default
n/a
Response
n/a
See Also
[
=
],
[
&
],
[
^
],
[
|
],
[
<<
],
[
>>
],
VAR, VARI,
VARB
Product Rev
GT6K 6.0
GV6K 6.0
The Boolean Not (
~
) operator performs a logical NOT on the value immediately to its right when used with
the
VAR
or
VARI
command. The Boolean NOT (
~
) performs a bitwise NOT on the value immediately to its
right when used with the
VARB
command. Parentheses (
()
) are required.
For a logical NOT (using
VAR
or
VARI
), the possible combinations are as follows:
~
(
positive number
)
=
0
~
(
zero or a negative number
)
=
1
Example:
VAR1=~(5)
; Result:
VAR1=0
Example:
VAR1=~(-1)
; Result:
VAR1=1
For a bitwise NOT (using
VARB
), each bit is
NOTed
.
Example:
VARB1=~(b0000
1000
1XX1)
Response to
VARB1
is
*VARB1=1111_0111_0XX0_XXXX_XXXX_XXXX_XXXX_XXXX
Example:
VARB1=~(h32FD)
Response to
VARB1
is
*VARB1=0011_1011_0000_0100_1111_1111_1111_1111
The total command length must be less than 80 characters. The order of precedence is
left to right
.
The Boolean Not (
~
) operator also has one additional use. It can be used to change the sign of the distance
(
D
) command. For example, if the distance has the value
*D+25000
, by issuing
D~
the new value for
distance would be
*D-25000
.
www.comoso.com
Содержание Gemini GT6K
Страница 24: ...www comoso com ...
Страница 40: ...www comoso com ...
Страница 344: ...www comoso com ...
Страница 350: ...www comoso com ...