beautypg.com

2 subtraction, 2 subtraction (–) – HEIDENHAIN TNC 335 Technical Manual User Manual

Page 437

background image


7-58

TNC 360

3 Commands

8/95

3.4.2 SUBTRACTION (–)

Abbreviation for the PLC Editor:

– (MINUS)

Logic

Byte/Word

Double

Constant

Execution time [µs]

----

2.8/2.4

1.8

1.6

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 subtracted from the contents of the Word Accumulator. The
result of the operation is stored in the Word Accumulator and may be processed further.

Example:
A stored value in Word W6 is to be subtracted from a Constant. 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 the 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

9 9

8 0 0

2 0 0

3

= D8

9 9

8 0 0

9 9

8 0 0

Line 1:

The Constant is loaded into the Accumulator.

Line 2:

The contents of Word W6 are subtracted from the Accumulator.

Line 3:

The result is assigned to Doubleword D8.