Q, QL & QR — Parameter Scope

Tell the three parameter families apart and use plain Q for everyday math.

Three families share the same arithmetic. Q parameters are global and live for the whole program; QL parameters are local to a subprogram call; QR parameters are remanent — they survive a power-off. For everyday calculations you reach for plain Q, which is what this exercise uses.

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

A plate is Q1 long and Q2 wide. Compute its corner-to-corner diagonal into Q10 with Pythagoras (the square root of length squared plus width squared), and its area into Q11.

The machine gives you

3 x 4 plate:Q1 = 3Q2 = 4
6 x 8 plate:Q1 = 6Q2 = 8

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.