Arithmetic & Trig

Do trigonometry in Klartext and know the control works in degrees.

Klartext applies a function to whatever follows it — COS Q4, no brackets needed — and trig is in degrees. COS 30 is 0.866, not the radian answer a calculator would give.

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

The machine hands you a radius in Q1 and an angle in degrees in Q2. Compute the point on the circle at that angle: Q10 = the X distance, Q11 = the Y distance.

The machine gives you

40 mm radius at 30°:Q1 = 40Q2 = 30
25 mm radius at 60°:Q1 = 25Q2 = 60

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.