4

MOD (INT, DINT)

The Modulo (MOD) function is used to divide one value by another value 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 MOD function operates on these types of data:

Data Type

Description

INT

Signed integer.

 

 

DINT

Double precision signed integer.

 

 

The default data type is signed integer; however, it can be changed after selecting the function. For more information on data types, please refer to chapter 2, section 2, “Program Organization and User References/Data.”

When the function receives power flow, it divides input parameter I1 by input parameter I2. These parameters must be the same data type. Output Q is calculated using the formula:

Q = I1 - ((I1 DIV I2) * I2)

where DIV produces an integer number. Q is the same data type as input parameters 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.

 

 

_____

 

 

(enable)

 

 

(ok)

 

 

 

INT

 

 

(input parameter I1)

—I1

Q— (output parameter Q)

 

 

(input parameter I2)

I2

 

_____

Parameters:

 

 

 

Parameter

Description

 

 

 

 

enable

When the function is enabled, the operation is performed.

 

 

I1

I1 contains a constant or reference for the value to be divided by I2.

 

 

I2

I2 contains a constant or reference for the value to be divided into I1.

 

 

ok

The ok output is energized when the function is performed without overflow.

 

 

Q

Output Q contains the result of dividing I1 by I2 to obtain a remainder.

 

 

GFK-0467K

Chapter 4 Series 90-30/20/Micro Instructions Set

4-31

Page 112
Image 112
GE 90-30/20/Micro manual MOD INT, Dint, Data Type Description