5 remainder, 5 remainder [ ] (mod[ ]) mod – HEIDENHAIN TNC 335 Technical Manual User Manual

Page 454

Advertising
background image


8/95

TNC 360

3 Commands

7-75

3.7.5 REMAINDER [ ] (MOD[ ])

MOD [ ]

Abbreviation for PLC Editor:

MOD [ ] (MODULO [ ])

Logic

Byte/Word/Double

Execution time [µs] *) **)

-----

20.6

Number of bytes

-----

14

*) See Multiplication
**) See Division

In the event of an error (Divisor = 0) in the Division and MODULO functions, the execution time will
be in the range 0.9 to 1.3 µs.

Operands: none

Function of Parentheses with Arithmetic Commands:
With arithmetic commands, only word execution is possible. The execution sequence in a ladder
may be altered by the use of parentheses. The "open-parentheses" command loads the content of
the Word Accumulator onto the Program Stack. Then the Accumulator is available for the calculation
of intermediate results. The "close parentheses" instruction initiates the gating of the buffered value
from the Program Stack with the content of the Word Accumulator. The result is again loaded into
the Accumulator. The maximum nesting level is 16 parentheses.

Example for the commands ADD [ ], SUBTRACT [ ], MULTIPLY [ ], DIVIDE [ ], DIVISION
REMAINDER [ ]
The following example demonstrates how parentheses influence the result of the operation.

Initial state:

Constant

= 1000

(decimal)

DoublewordD12

= 15000

(decimal)

DoublewordD36

= 100

(decimal)

DoublewordD100 = ?

The specification of Accumulator and operand contents is given in decimal notation. The ten-place
Accumulator thus permits the maximum possible Accumulator content of (2 147 483 647).

Advertising