Galil Motion Control manc 18x 6 Page 15
DMC-18x6 Command Reference
7
& |
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:
complement
statement
statement
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