Main Content


Evaluate expression

  • CPT block



The CPT block implements the CPT ladder logic instruction. When the rung conditions are true, the block evaluates the expression Expr and outputs the result to the destination (dest).


  • The CPT ladder diagram instruction does not support direct operand calls. Currently MOD, AND, XOR, FTD, and TOD instructions are unsupported as CPT operands.



expand all

Controls the execution of the block. EnableIn reflects the rung state preceding the block. If the rung state preceding the block is false, EnableIn is false, the block does not execute and the outputs are not updated.


expand all

By default, EnableOut follows the state of EnableIn. If the EnableIn input to the block is false, the logic implemented by the block is not executed and EnableOut signal is set to false.

The result obtained after computing the expression is placed at the destination.

Data Types: int8 | int16 | int32 | single


expand all

Specify the expression to be evaluated. An expression consisting of tags and/or immediate values separated by operators. In Ladder Diagrams, tags (variables) are used to represent inputs, outputs, and internal memory with attributes such as Data Type, Initial Value, and size. To change the attributes of the Expression to Evaluate, open the Program Variables table within the Ladder Diagram Program block.

Programmatic Use

Block Parameter: PLCOperandTag
Type: character vector
Value: character vector
Default: 'Expr'

Version History

Introduced in R2019a

See Also

| | |