Compute (CPT)

The CPT instruction performs the arithmetic operations you define in the expression.

Available Languages
-    Ladder Diagram

-    Function Block
This instruction is not available in function block.

-    Structured Text
 This instruction is not available in structured text. *

* There is no equivalent structured text instruction. Use other structured text programming to achieve the same result.

Operands
-    Ladder Diagram

Operand
Type
Format
Description
Destination
SINT
INT
DINT
REAL
tag
tag to store the result
Expression
SINT
INT
DINT
REAL
immediate
tag
an expression consisting of tags and/or immediate values separated by operators.





-    Structured Text
Structured text does not have a CPT instruction, but you can achieve the same results using an assignment and expression.

destination := numeric_expression;

Example 1
When enabled, the CPT instruction evaluates value_1 multiplied by 5 and divides that result by the result of value_2 divided by 7 and places the final result in result_1.


Example 2
When enabled, the CPT instruction truncates float_value_1 and float_value_2 to the power of two and divides the truncated float_value_1 by that result, and then stores the remainder after the division in float_value_result_cpt.



File name: PLC-16_IS_CMI-CPT.pdf
File size: 397.84 KB

0 comments :