EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2 Instruction Descriptions
2-164
NJ-series Instructions Reference Manual (W502)
The following example is for when In1 is INT#20000, In2 is INT#2 and variable abc has an INT data
type. The multiplication result (40000) exceeds the valid range of INT data, so the value of P_CY
changes to TRUE. The value of variable abc will be INT#25536 (the lower 16 bits of 40000).
The functions of the MulOU instruction and the *OU instruction are exactly the same. Use the form that
is easier to use.
Use the MUL (*) instruction (page 2-161) if there is no need for an overflow/underflow check. It will
reduce processing time.
Set the data type of Out to include the valid ranges of In1 to InN.
If In1 to InN and Out are integers, make sure the multiplication result will fit in the valid range of Out.
Otherwise, the value of Out will be an illegal value. An error will not occur.
If the data types of In1 to InN are different, calculations and processing of P_CY are performed with
the data type that includes all of the data types of In1 to InN. For example, if In1 is INT data and In2 is
DINT data, calculations and P_CY processing are performed with DINT data.
If In1 to InN contains real data, the value of P_CY does not change.
Multiplication results of positive or negative infinity are handled as follows for real number values.
Related System-defined Variables
Name Meaning Data type Description
P_CY Carry (CY) Flag BOOL TRUE: There is an overflow or underflow.
FALSE: There is no overflow or underflow.
Additional Information
Precautions for Correct Use
Multiplication
Multiplication
result
+ times positive number +
+
times negative number −∞
−∞
times positive number −∞
−∞
times negative number +
+
times + +
−∞
times −∞ +
+
times −∞ −∞
+
times 0
Nonnumeric
data
−∞ times 0
Nonnumeric
data
abc:=MulOU(INT#20000, INT#2);
LD ST
abc
INT#20000
INT#2
MulOU
EN ENO
In1
In2

Table of Contents

Related product manuals