Math And Numerical Functions Modulo Division - GE VersaMax PLC User Manual

Table of Contents

Advertisement

%I0004
%I0005
%M0001
%R0201
CONST
+00001
%M0002
%R0201
CONST
+00001
164
GFK-1503E
For public disclosure
10.5.1.4 Example
This example uses the Addition and Subtraction functions to keep track of the number of
parts in a temporary storage area. Each time a part enters the storage area, power flows
through relay %I0004 to a positive transition coil with reference %M0001. Relay %
M0001 then enables the Addition function, adding the (constant) value 1 to the current
total value in %R0201.
Each time a part leaves the storage area, power flows through relay %I0005 to a positive
transition coil with reference %M0002. Relay %M0002 then enables the Subtraction
function, subtracting the (constant) value 1 from the current total value in %R0201.
ADD_
INT
I1 Q
%R0201
I2
SUB_
INT
I1 Q
%R0201
I2
10.5.2 Math and Numerical Functions Modulo
Division
The Modulo Division function divides one value by another of the same data type, to
obtain the remainder. The sign of the result is always the same as the sign of input
parameter I1. The Modulo function operates on these types of data:
Signed integer
INT
Double precision signed integer
DINT
When the function receives power flow, it divides input I1 by input I2. These parameters
must be the same data type. Output Q is calculated using the formula:
Q = I1-((I1 DIV I2) * I2)
The division produces an integer. Q is the same data type as inputs I1 and I2.
OK is always ON when the function receives power flow, unless there is an attempt to
divide by zero. In that case, it is set OFF.
MOD_
Enable
INT
Input 1
I1 Q
I2
Input 2
OK
Output
%M0001
%M0002
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents