7 – 130 HEIDENHAIN Technical Manual TNC 426, TNC 430
Example:
Example for the commands ADD [ ], SUBTRACT [ ], MULTIPLY [ ], DIVIDE [ ],
REMAINDER [ ].
Divide a constant by double word D36, add the result to double word D12, and
assign the result to double word D100.
Initial state:
Constant = 1000 (dec)
Double word D12 = 15000 (dec)
Double word D36 = 100 (dec)
Double wordD100 = ?
Function STL Accumulator content (dec) Operand content (dec)
x xxx xxx xxx
Load the double
word D12 into the
word accumulator.
L D12 1 5 0 0 0 15 000
Opening
parenthesis: Buffer
the accumulator
content onto the
program stack.
+[ 1 5 0 0 0
Load the constant K
1000 into the word
accumulator.
L K1000 1 0 0 0
Divide the word
accumulator by the
content of the
double word D36.
/ D36 1 0 1 0 0
Closing parenthesis:
Gate the
accumulator content
with the program
stack (+[, –[ .....).
] 1 5 0 1 0
Assign the result of
the total operation to
double word D100.
= D100 15 010 15 010
Set Reset
M4200 Overflow during multiplication NC PLC
M4201 Division by 0 NC PLC
M4202 Incorrectly executed modulo NC PLC
M4203 Error status for PLC module NC NC/PLC