Round system parameter to tenths?

More
1 year 2 months ago #333754 by xenon-alien

But if you just want to compare two numbers to see if they differ by less than a certain amount:

Code:
O100 IF [ ABS[#100 - #101] LT 0.01]   <do stuff> O100 ENDIF https://linuxcnc.org/docs/html/gcode/overview.html#gcode:functions https://linuxcnc.org/docs/stable/html/gcode/o-code.html#ocode:conditional  

Thank you.
I saw that documents, but  I'm not realized it can be done so simple way...

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #333932 by xenon-alien
I figured out how to make it work the axis alignment
But on 2.8.4 LCNC my code hangs out the LCNC when i uncomment the:
O100 do
O100 while [#_<ValueABS> GT 0.007]
The whole code in the attachment.

I want to combine 3 measurings in one file (also in attachment), but the same result - The LCNC freezes out without errors.

The decimal test code works fine
Maybe the global parameters makes the issue?
Can anyone tell how to solve this?

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #334042 by andypugh
You may be seeing a problem caused by the G-code preview. That runs through the code to draw the lines, but won't update values based on probe results etc (as it doesn't _move_ anything).

The trick here is probably
Code:
O100 while [#<_task> EQ 1.0 AND #<_deltaabs> GT 0.007]

Which will end the loop early in preview generation.

linuxcnc.org/docs/stable/html/gcode/over...ub:system-parameters
The following user(s) said Thank You: xenon-alien

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago - 1 year 2 months ago #334076 by xenon-alien

The trick here is probably
Code:
O100 while [#<_task> EQ 1.0 AND #<_deltaabs> GT 0.007]
 
Thank you! It's HELPED!!
 
Last edit: 1 year 2 months ago by xenon-alien.

Please Log in or Create an account to join the conversation.

Time to create page: 0.160 seconds
Powered by Kunena Forum