Remainder (Mod) - HEIDENHAIN TNC 426 PB/M Technical Manual

Table of Contents

Advertisement

7.7.29 REMAINDER (MOD)

Function
Load W6 into the
word accumulator.
Divide the content of
the word
accumulator by a
constant, then save
the integral
REMAINDER in the
word accumulator.
Assign the
REMAINDER to
double word D8.
7 – 118
Syntax:
MOD (MODULO)
Operands:
B, W, D, K
Action:
The TNC extends the operand to the width of the accumulator (32 bits) and
then calculates the remainder resulting from the division of the content of the
word accumulator by the content of the operand. The remainder is stored in
the word accumulator where you can process it further. If the TNC cannot
execute the MOD command correctly, it sets marker M4202; otherwise it
resets it.
Example:
Divide the number saved in word W6 by the constant, then calculate the
REMAINDER and assign the result to double word D8.
Initial state:
Word
W6
Constant
Double word D8
To improve clarity, the contents of the accumulator and operand are shown in
decimal notation. The ten-digit accumulator results from the greatest possible
accumulator content (2 147 483 647).
STL
Accumulator content (dec)
L W6
MOD
K15
= D8
M4202
Incorrectly executed modulo
= 50 (dec)
= 15 (dec)
= ?
x
x x x
x x x
x x x
HEIDENHAIN Technical Manual TNC 426, TNC 430
Operand content (dec)
5 0
5
5
Set
Reset
NC
PLC
5 0
1 5
5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tnc 430 pa/mTnc 430 mTnc 426 cbTnc 430 caTnc 426 pbTnc 430 pa ... Show all

Table of Contents