Instruction Set Quick Reference

D-7

 

 

Compute Instructions

Instruction

Description

 

 

CPT

 

 

 

 

COMPUTE

 

Dest

N7:3

 

 

3

Expression

N7:4 - (N7:6 * N7:10)

Compute

CPT

If the input conditions go true, evaluate the Expression N7:4 - (N7:6 * N7:10) and store the result in the Destination (N7:3).

The CPT instruction can perform these operations: add (+), subtract (-), multiply (*), divide (), convert from BCD (FRD), convert to BCD (TOD), square root (SQR), logical and (AND), logical or (OR), logical not (NOT), exclusive or (XOR), negate (-) clear (0), and move, X to the power of Y (**), radians (RAD), degrees (DEG), log (LOG), natural log (LN), sine (SIN), cosine (COS), tangent (TAN), inverse sine (ASN), inverse cosine (ACS) inverse tangent (ATN), and complex expressions (up to 80 characters)

ACS

ARCCOSINE

Source F8:19 0.7853982

DestF8:20 0.6674572

Arc cosine

ACS

If input conditions go true, take the arc cosine of the value in F8:19 and store the result in F8:20.

Status

Description

Bit

 

C

always resets

 

 

V

sets if overflow is generated;

otherwise resets

Zsets if the result is zero; otherwise resets

S

always resets

 

ADD

 

 

 

 

 

 

ADD

 

 

Source A

N7:3

 

 

 

3

 

Source B

N7:4

 

 

 

1

 

Dest

N7:12

 

 

 

4

 

 

 

 

Addition

ADD

When the input conditions are true, add the value in Source A (N7:3) to the value in Source B (N7:4) and store the result in the Destination (N7:12).

Status

Description

Bit

 

 

 

C

sets if carry is generated;

otherwise resets

 

 

 

V

sets if overflow is generated;

otherwise resets

 

 

Z

sets if the result is zero;

otherwise resets

 

 

 

S

sets if the result is negative;

otherwise resets

 

 

Publication 1785-UM012D-EN-P - July 2005

Page 307
Image 307
Bradley Smoker PLC-5 user manual Compute Instructions, Cpt, Acs, Add