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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compute/Math <strong>Instructions</strong> (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS) 249Compute (CPT)The CPT instruction performs the arithmetic operations you define inthe expression.Operands:Relay LadderOperand Type Format: DescriptionDestination SINTINTDINTtag tag to store the resultREALExpressionSINTINTimmediatetagan expression consisting of tags and/orimmediate values separated by operatorsDINTREALStructured TextA SINT or INT tag converts to a DINT value by sign-extension.Structured text does not have a CPT instruction, but you can achievethe same results using an assignment and expression.destination := numeric_expresion;See Appendix for information on the syntax of assignments andexpressions within structured text.Description:The CPT instruction performs the arithmetic operations you define inthe expression. When enabled, the CPT instruction evaluates theexpression and places the result in the Destination.The execution of a CPT instruction is slightly slower and uses morememory than the execution of the other compute/math instructions.The advantage of the CPT instruction is that it allows you to entercomplex expressions in one instruction.TIPThere is no limit to the length of an expression.Arithmetic Status Flags:Fault Conditions:Arithmetic status flags are affected.nonePublication 1756-RM003I-EN-P - January 2007

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

Saved successfully!

Ooh no, something went wrong!