User`s manual

12-8 Motion Mate DSM314 for Series 90-30 PLCs User's Manual
January 2001 GFK-1742A
12
Local Logic Arithmetic Operators
The Local Logic language contains familiar constructs to perform basic signed integer arithmetic
computations. The language supports 32-bit arithmetic in the Local Logic program and limited use
of 64/32-bit arithmetic. All operations require two operands except for the ABS function, which
returns the absolute value of a variable or numeric constant.
Table 12-3. Arithmetic Operators
Operator Meaning
+ Addition
-Subtraction
* Multiplication
/ Integer Division
MOD Modulus
ABS Absolute Value
Arithmetic expressions may only be used in assignment statements with one operation per
statement.
The arithmetic operations do not require data type conversion functions since the motion module
automatically does this operation.
Operator +
Adds source1 to source2 and stores the result in destination
Syntax
destination := source1 + source2;
The + operator syntax has these parts:
Part Description
Destination Any writeable local logic variable except Dxx registers.
source1 Any readable local logic variable/constant except Dxx registers.
source2 Any readable local logic variable/constant except Dxx registers.
Overflow
– Set if the result of an addition is greater than 2,147,483,647 or less than
–2.147,483,648. The Module_Status_Code is set to a value of 16#0095, which is a
status-only error.