Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
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).
LD
INT#20000
INT#2
The functions of the MulOU instruction and the *OU instruction are exactly the same. Use the form that
is easier to use.
Related System-defined Variables
Name
P_CY
Additional Information
Use the MUL (*) instruction (page 2-161) if there is no need for an overflow/underflow check. It will
reduce processing time.
Precautions for Correct Use
• 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.
Multiplication
+∞
times positive number
+∞
times negative number
−∞
times positive number
−∞
times negative number
+∞
+∞
times
−∞
−∞
times
−∞
+∞
times
+∞
times 0
−∞
times 0
2-164
ST
MulOU
EN
ENO
abc
In1
In2
Meaning
Carry (CY) Flag
BOOL
Multiplication
result
+∞
−∞
−∞
+∞
+∞
+∞
−∞
Nonnumeric
data
Nonnumeric
data
abc:=MulOU(INT#20000, INT#2);
Data type
TRUE: There is an overflow or underflow.
FALSE: There is no overflow or underflow.

NJ-series Instructions Reference Manual (W502)

Description

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents