Compute instructions – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

Page 307

Advertising
background image

Publication 1785-UM012D-EN-P - July 2005

Instruction Set Quick Reference D-7

Compute Instructions

Instruction

Description

Compute
CPT

Arc cosine
ACS

Addition
ADD

CPT

COMPUTE

Dest

Expression

N7:3

3

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

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

Dest

F8:19

F8:20

0.7853982

0.6674572

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

always resets

sets if overflow is generated;

sets if the result is zero;

Status

C

V

Z

S

Description

Bit

otherwise resets

otherwise resets

always resets

ADD

ADD

Source A

Source B

Dest

N7:3

N7:4

N7:12

3

1

4

sets if carry is generated;

sets if overflow is generated;

sets if the result is zero;

sets if the result is negative;

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

C

V

Z

S

Description

Bit

otherwise resets

otherwise resets

otherwise resets

otherwise resets

Advertising