GE VersaMax PLC User Manual page 163

Table of Contents

Advertisement

Input/ Output
I2
ok
Q
Instruction Set Reference
For public disclosure
Choices
I2 contains a constant or reference for the
All data types: R, AI, AQ,
second value used in the operation. (I2 is on the
constant
right side of the mathematical expression, as in
INT data type only: I, Q,
I1 + I2). Range for constants in doubleprecision
M, T, G
signed integer operations is minimum/maximum
DINT.
The OK output is energized when the function is
flow, none
performed without overflow, unless an invalid
operation occurs.
All data types: R, AI, AQ
Output Q contains the result of the operation.
INT only: I, Q, M, T, G
10.5.1.2 Data Types for Standard Math Functions
Standard math functions operate on these types of data:
Signed integer
INT
Double precision signed integer
DINT
Floating Point
REAL
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.
Description
GFK-1503E User Manual 163

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents