beautypg.com

4 arithmetic commands, 1 addition (+) – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 527

background image


7-66

TNC 407/TNC 415/TNC 425

3 Commands

01.98

7

3.4 Arithmetic Commands

7

3.4.1 ADDITION (+)

Abbreviation for the PLC-Editor:

+ (PLUS)

Logic

Byte/Word

Double

Constant

Execution time [µs]

----

0.5 to 0.7

0.2 to 0.7

0.1 to 0.5

Number of bytes

----

8

4

6

Operands: B, W, D, K

Operation:
With arithmetic functions the operand is firstly expanded to the size of the Accumulator (32 bits).
Then the contents of the operand are added to the Word Accumulator. The result of the operation is
stored in the Word Accumulator and may be processed further.

Example:
A constant and a stored value in Word W6 are to be added. The result is then stored in Doubleword
D8.

Initial state:

Constant

= 100 000

(dec)

Word

W6 = 200

(dec)

Doubleword D8 = ?

In the interests of clarity the contents of the Accumulator and operand are shown in decimal
notation.
The 10 bit wide Accumulator allows the entry of the highest possible Accumulator contents
(2 147 483 647).

Line Instruction

Accumulator Contents

Operand Contents

x

x x x

x x x

x x x

1

L K100000

1 0 0

0 0 0

2

+ W6

1 0 0

2 0 0

2 0 0

3

= D8

1 0 0

2 0 0

1 0 0

2 0 0

Line 1:

The Constant is loaded into the Accumulator.

Line 2:

The contents of the Accumulator and Word W6 are added.

Line 3:

The result is assigned to Doubleword D8.