Math And Numerical Functions Add, Subtract,Multiply, Divide - Emerson PaCSystems VersaMax Series User Manual

Table of Contents

Advertisement

User Manual
GFK-1503F
Converting Data for the Math and Numerical Functions
The program may need to include logic to convert data to a different type before using a
Math or Numerical function. The description of each function includes information about
appropriate data types. The section Data Type Conversion Functions explains how to
convert data to a different type.
10.5.1
Math and Numerical Functions Add, Subtract,Multiply,
Divide
The standard math functions are Addition, Subtraction, Multiplication, and Division. The
Division function rounds down; it does not round to the closest integer. (For example, 24
DIV 5 = 4.)
When a math function receives power flow, the operation is performed on input parameters
I1 and I2. Parameters I1, I2, and output Q must be the same data type.
Figure 123
The math functions pass power if there is no math overflow. If an overflow occurs, the result
is the largest value with the proper sign and no power flow.
Parameters of the Standard Math Functions
Input/
Output
enable
I1
I2
ok
Q
Instruction Set Reference
Choices
Description
flow
When the function is enabled, the operation is performed.
All data types: R, AI, AQ,
I1 contains a constant or reference for the first value used in
constant
the operation. (I1 is on the left side of the mathematical
expression, as in I1 + I2).
INT data type only: I, Q,
M, T, G
Range for constants in double-precision signed integer
operations is minimum/maximum DINT.
All data types: R, AI, AQ,
I2 contains a constant or reference for the second value
constant
used in the operation. (I2 is on the right side of the
mathematical expression, as in I1 + I2). Range for constants
INT data type only: I, Q,
in double-precision signed integer operations is
M, T, G
minimum/maximum DINT.
flow, none
The OK output is energized when the function is 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
Chapter 10
Jan 2020
141

Advertisement

Table of Contents
loading

Table of Contents