EasyManuals Logo

Omron NJ501-1500 User Manual

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
Page #147 background imageLoading...
Page #147 background image
2-99
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Comparison Instructions
2
Cmp
The Cmp instruction compares two values (In1 and In2) and outputs flag values.
The values of the flags are as follows:
The following example is for when In1 is INT#10 and In2 is INT#20. The values of variables def, ghi, and
jkl will be FALSE, and the values of abc, mno, pqr, and stu will be TRUE.
• If the data types of In1 and In2 are different, the smaller one is expanded to a data type that includes
the ranges of both of the data types.
• If In1 and In2 are real numbers, error may cause unexpected processing results. This can occur, for
example, when they contain non-terminating decimal numbers.
• Signed integers (SINT, INT, DINT, and LINT) cannot be compared to unsigned integers (USINT, UINT,
UDINT, and ULINT).
• Two values that are positive infinity or two values that are negative infinity are equivalent.
• If the value of either In1 or In2 is nonnumeric data, the values of OutEQ, OutGT, OutGE, OutNE,
OutLT, and OutLE are FALSE.
Function
Flag Value
OutEQ If In1 equals In2, the flag shows TRUE. Otherwise the flag shows FALSE.
OutGT If In1 is greater than In2, the flag shows TRUE. Otherwise the flag shows
FALSE.
OutGE If In1 is greater than or equal to In2, the flag shows TRUE. Otherwise the
flag shows FALSE.
OutNE If In1 is not equal to In2, the flag shows TRUE. Otherwise the flag shows
FALSE.
OutLT If In1 is less than In2, the flag shows TRUE. Otherwise the flag shows
FALSE.
OutLE If In1 is less than or equal to In2, the flag shows TRUE. Otherwise the flag
shows FALSE.
Precautions for Correct Use
abc:=Cmp(INT#10, INT#20, def, ghi, jkl, mno, pqr, stu);
LD ST
abc
def
ghi
jkl
mno
pqr
stu
INT#10
INT#20
Cmp
EN ENO
In1
In2 OutEQ
OutGT
OutGE
OutNE
OutLT
OutLE

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals