
Local Logic Language Syntax
GFK-1742A Chapter 12 Local Logic Language Syntax 12-11
12
Operator MOD
The MOD operator returns the remainder resulting from the signed integer division of
source1 by source2. A double precision (64-bit) parameter register may be used as the
numerator.
Syntax
1
destination := source1 MOD source2;
Syntax
2
destination := double source1 MOD source2;
The MOD operator syntax has these parts:
Part Description
Destination Any writeable local logic variable except Dxx registers.
source1 Any readable local logic variable or numeric constant.
double source1 Any of the 64-bit local logic parameter variables (Dxx registers).
source2 Any readable local logic variable/constant except Dxx registers.
Overflow
- See
remarks
below.
Remarks
In case of a divide by zero, the Module_Status_Code is set to 16#2093. In case of a
divide overflow, the Module_Status_Code is set to 16#2094.
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.
Komentarze do niniejszej Instrukcji