I want to call subprogram in CSE in heidenhain. for example:
for example :
FN 0: Q21=1.7319121e-14
FN 9: IF +Q21 EQU +0.0 GOTO LBL "Z AXIS"
Now Q21 is not equal 0 in subprogram in CSE,
I want to set Q21 value only 4 decimal points, then Q21=0
How to set Q21 only 4 decimal points?
Appreciate everyone's help.
I guess you have to define it in your post processor.
change -> your_variable
[format %.4f "$your_variable"]
Then you will get 4 digits on your_variable.
this variable is not in post processor.
Q value is in the subprogram which call by CSE. (position:C:\Program Files\Siemens\NX 11.0\MACH\resource\library\machine\installed_machines\...........\cse_driver\heidenhainTNC\subprog)
When compare a float or double value against 0.0 I would not suggest to do this with
if value_to_check==0 a==b
adding a tolerance and do the absolute before.
ABS(value_to_check) < tolerance
I am not yet how that need to look into the TNC format
Then try what Thomas said:
FN3: Q2 = +Q21 * +Q21
FN12: IF +Q2 LT +0.000001 GOTO LBL "Z AXIS"
Instead of Q2, use an empty Q parameter.