The FN Arithmetic Functions

Do the same arithmetic with the explicit FN functions you'll meet in posted code.

The same arithmetic has an older, explicit spelling: FN 0 assigns, FN 1 adds, FN 4 divides. You’ll meet it in older programs and posted output, so it’s worth being able to read — and write — both forms.

Read firstHeidenhain TNC 640: Klartext & Q-ParametersWriting macros on the Heidenhain TNC 640: Klartext program structure, labels and subprograms, Q/QL/QR/QS parameter types and ranges, FN functions for math and jumps, string processing, FN 14 error output, and DIN/ISO D-function equivalents.

Your turn

Two bore measurements came back in Q1 and Q2. Using the FN arithmetic functions — not the + and / operators — put their sum in Q10 and their average in Q11.

The machine gives you

29.98 and 30.02:Q1 = 29.98Q2 = 30.02
25.0 and 25.4:Q1 = 25Q2 = 25.4

Your program is run once for each set of conditions. It has to work for all of them.

Loading...

This is a learning simulation — always prove out a program on the actual control before you cut metal.