
User Manual
Chapter 12
GFK-1742F
Jan 2020
Local Logic Language Syntax
296
The modulus (remainder) is calculated by performing an integer division, therefore the
MOD operator has the same error conditions as the divide operator.
A divide overflow occurs when the quotient of a divide operation cannot be correctly be
represented as a signed 32-bit value. This can only occur when using a double operand as
the numerator. A divide by zero occurs when the denominator of the divide has a value of
zero.
A divide overflow or divide by zero are Stop Fast errors. Local Logic is immediately aborted,
and motion is aborted by setting the servo velocity command to zero.
12.4.5
Function ABS
The ABS function returns the unsigned magnitude of the variable or constant parameter.
Syntax
destination := ABS(parameter);
The ABS operator syntax has these parts:
Overflow
–
Set if the operand has a value of
–
2,147,483,648. The Module_Status_Code is
set to a value of 16#0096, which is a status-only error.
12.5
Local Logic Bitwise Logical Operators
All logical operations are performed on a bit-by-bit basis, for example the result of a
BWAND operation is composed of 32 and operations between each of the corresponding
bits of the operands. The logic operators are prefixed with ‘BW’ to highlight the fact that
they are not Boolean operators.
Table 57: Bitwise Logical Operators
Operator
Meaning
BWAND
Bitwise Logical AND
BWOR
Bitwise Logical OR
BWXOR
Bitwise Logical Exclusive OR
BWNOT
Bitwise Logical NOT (one’s
-complement)
Expressions using bitwise logical operators may be used in assignment or conditional
statements. Only one bitwise logical operator may be used per expression.