Input/ Output
Choices
Description
I2
All data types: R, AI, AQ,
constant
INT data type only: I, Q,
M, T, G
I2 contains a constant or reference for the
second value used in the operation. (I2 is on the
right side of the mathematical expression, as in
I1 + I2). Range for constants in doubleprecision
signed integer operations is minimum/maximum
DINT.
ok
flow, none
The OK output is energized when the function is
performed without overflow, unless an invalid
operation occurs.
Q
All data types: R, AI, AQ
INT only: I, Q, M, T, G
Output Q contains the result of the operation.
10.5.1.2
Data Types for Standard Math Functions
Standard math functions operate on these types of data:
INT
Signed integer
DINT
Double precision signed integer
REAL
Floating Point
The input and output parameter data types must be the same (16 bits or 32 bits).
10.5.1.3
Avoiding Overflows
Be careful to avoid overflows when using Multiplication and Division functions.
If you have to convert Integer to Double-Precision Integer values, remember that the CPU
uses standard 2’s complement with the sign extended to the highest bit of the second
word. You must check the sign of the low 16-bit word and extend it into the second 16 bit
word. If the most significant bit in a 16-bit INT word is 0 (positive), move a 0 to the
second word. If the most significant bit in a 16-bit word is –1 (negative), move a – 1 or
hex 0FFFFh to the second word.
Converting from Double-Precision Integer to Integer data is easier, because the low 16-
bit word (first register) is the integer portion of a Double-Precision Integer 32-bit word.
The upper 16 bits or second word should be either a 0 (positive) or –1 (negative) value or
the Double-Precision Integer number will be too big to convert to 16 bits.
Instruction Set Reference
GFK-1503E User Manual 163
For public disclosure
Summary of Contents for VersaMax PLC
Page 16: ...Notes 16 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 38: ...Notes 38 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 50: ...Notes 50 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 92: ...Notes 92 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 112: ...Notes 112 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 224: ...Notes 224 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 292: ...Notes 292 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 316: ...Notes 316 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 317: ......