Publication 1766-RM001A-EN-P - October 2008
234
Math Instructions
CPT - Compute
Instruction Type: output
The CPT instruction performs copy, arithmetic, logical, and conversion
operations. You define the operation in the Expression and the result is
written in the Destination. The CPT uses functions to operate on one or
more values in the Expression to perform operations such as:
•
converting from one number format to another.
•
manipulating numbers.
•
performing trigonometric functions.
Enter the following parameters when programming this instruction:
•
Expression is zero or more lines, with up to 28 characters per line,
up to 255 characters.
•
Destination is a word address or the address of a floating-point data
element.
IMPORTANT
The XPY instruction processes at the floating-point level, so the result causes
the truncation error when it is used with the long data types.
AB
S
Compute
Dest
N7
:
4
0<
Expression
(N7
:
0 + N7
:
1)
CPT
AB
S
Compute
Dest
N7
:
4
0<
Expression
(N7
:
0 + N7
:
1)
*
(N7
:
2 + N7
:
3)
CPT
Execution Time for the CPT Instruction
Controller
Data Size
When Rung Is:
True
False
MicroLogix 1400
word
4.8535 µs
0.6610 µs
TIP
The execution time of a CPT instruction is longer than a single arithmetic
operation and uses more instruction words.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive