EasyManuals Logo
Home>Allen-Bradley>Controller>Logix5000

Allen-Bradley Logix5000 Reference Manual

Allen-Bradley Logix5000
708 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 #221 background imageLoading...
Page #221 background image
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 221
Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ) Chapter 5
Compare (CMP)
The CMP instruction performs a comparison on the arithmetic operations you
specify in the expression.
Operands:
Relay Ladder
Structured Text
Structured text does not have a CMP instruction, but you can achieve the same
results by using an IF...THEN construct and expression.
IF BOOL_expression THEN
<statement>;
END_IF;
See Structured Text Programming
for information on the syntax of constructs
and expressions within structured text.
Description: Define the CMP expression by using operators, tags, and immediate values. Use
parentheses ( ) to define sections of more complex expressions.
The execution of a CMP instruction is slightly slower and uses more memory
than the execution of the other comparison instructions. The advantage of the
CMP instruction is that it allows you to enter complex expressions in
one instruction.
Arithmetic Status Flags: The CMP instruction affects only the arithmetic status flags if the expression
contains an operator (for example, +, −, *, /) that affects the arithmetic
status flags.
Fault Conditions: None
Operand Type Format Description
Expression SINT
INT
DINT
REAL
string
Immediate Tag An expression consisting of tags and/or
immediate values separated by operators.
A SINT or INT tag converts to a DINT value by sign-extension.

Table of Contents

Other manuals for Allen-Bradley Logix5000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley Logix5000 and is the answer not in the manual?

Allen-Bradley Logix5000 Specifications

General IconGeneral
BrandAllen-Bradley
ModelLogix5000
CategoryController
LanguageEnglish

Related product manuals