Galil Motion Control optcom Page 14
Optima DMC-1xxx and DMC-18x2 Command Reference
& |
i
3
& |
FUNCTION: Bitwise Logical Operators AND and OR
DESCRIPTION:
The operators & and | are typically used with IF, JP, and JS to perform conditional jumps;
however, they can also be used to perform bitwise logical operations.
ARGUMENTS: n & m or n | m where
n and m are signed numbers in the range -2147483648 to 2147483647.
For IF, JP, and JS, n and m are typically the results of logical expressions such as (x > 2)
USAGE: DEFAULTS:
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format
-
Command Line
Yes
Controller Usage
ALL
RELATED COMMANDS:
@
COM
[n] Bitwise
complement
IF
If
statement
JP
Jump
statement
JS
Jump
subroutine
EXAMPLES:
IF (x > 2) & (y = 4)
MG "true"
ENDIF
;x must be greater than 2 and y equal to 4 for the message to print
:MG 1 | 2
3.0000
::
;'Bitwise operation: 01 OR 10 is 11 = 3