12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compare <strong>Instructions</strong> (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ) 207Compare (CMP)The CMP instruction performs a comparison on the arithmeticoperations you specify in the expression.Operands:Relay LadderOperand Type Format DescriptionExpression SINT immediate an expression consisting of tags and/orimmediate values separated by operatorsINT tagDINTREALstringStructured TextA SINT or INT tag converts to a DINT value by sign-extension.Structured text does not have a CMP instruction, but you can achievethe same results using an IF...THEN construct and expression.IF BOOL_expression THEN;END_IF;See Appendix for information on the syntax of constructs andexpressions within structured text.Description:Define the CMP expression using operators, tags, and immediatevalues. Use parentheses ( ) to define sections of morecomplex expressions.The execution of a CMP instruction is slightly slower and uses morememory than the execution of the other comparison instructions. Theadvantage of the CMP instruction is that it allows you to entercomplex expressions in one instruction.Arithmetic Status Flags:Fault Conditions:The CMP instruction only affects the arithmetic status flags if theexpression contains an operator (for example, +, −, *, /) that affectsthe arithmetic status flags.nonePublication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!