Cancel
Showing results for 
Search instead for 
Did you mean: 

how do I set Q value only 4 decimal point s in subprogram

Pioneer
Pioneer

Hi  everybody,

 

  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.

 

4 REPLIES

Re: how do I set Q value only 4 decimal point s in subprogram

Valued Contributor
Valued Contributor

Hello,

 

I guess you have to define it in your post processor.

 

change -> your_variable

to

[format %.4f "$your_variable"]

 

Then you will get 4 digits on your_variable.

 

Kind regards,

Majid

Re: how do I set Q value only 4 decimal point s in subprogram

Pioneer
Pioneer

hello

 

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)

 

thank you

Re: how do I set Q value only 4 decimal point s in subprogram

Siemens Phenom Siemens Phenom
Siemens Phenom

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

Thomas Schulz
Siemens PLM
Manufacturing Engineering Software

Re: how do I set Q value only 4 decimal point s in subprogram

Valued Contributor
Valued Contributor

Hello,

 

Then try what Thomas said:

 

FN0: Q21=1.7319121e-14
FN3: Q2 = +Q21 * +Q21
FN12: IF +Q2 LT +0.000001 GOTO LBL "Z AXIS"

 

Instead of Q2, use an empty Q parameter.

 

Kind regards,

Majid

Majid

Learn online





Solution Information