Publication 1747-RM001G-EN-P - November 2008
Math Instructions 4-25
Compute (CPT)
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.
Use this instruction with SLC 5/03 (OS302), SLC 5/04 (OS401), and SLC
5/05 processors.
Instructions that can be used in the Expression include:
+, -, *, | (DIV), SQR, - (NEG), NOT, XOR, OR, AND, TOD, FRD, LN,
TAN, ABS, DEG, RAD, SIN, COS, ATN, ASN, ACS, LOG, and ** (XPY).
Entering Parameters
Enter the following parameters when programming this instruction.
• Destination can be a word address or the address of a floating-point
data element
• Expression is zero or more lines, with up to 28 characters per line, up to
255 characters
CPT
Compute
Dest N7:36
3<
Expression ( N7:13 AND N7:14 ) OR N7:15
CPT
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
•••
TIP
The execution time of a CPT instruction is longer
than a single arithmetic operation and uses more
instruction words.