Do While problem

More
02 Jan 2013 04:11 #28284 by tricky-dicky1945
Replied by tricky-dicky1945 on topic Do While problem
#<X_passes>
The code as sent supposedly increments twice where it should be once. However when checked after the "Do" it is zero. BTW the User Manual index says "Break" is discussed on page 158 but I cannot see it!

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

More
02 Jan 2013 04:28 - 02 Jan 2013 04:29 #28285 by BigJohnT
Replied by BigJohnT on topic Do While problem
You have to scroll down a tad to see the break part of the loop. For sure you have an infinite loop going on when I commented out the break line...

Ok, your assigning the value of Height_Machined_away to Z_cutting_height so your outer loop will always remain true.
o302 If [#<Z_cutting_height> LT #<Height_Machined_away>]
	#<Z_cutting_height>=#<Height_Machined_away>
o302 endif

Take a look at my lathe facing subroutine for some hints on how to step down in depth.

John
Last edit: 02 Jan 2013 04:29 by BigJohnT.

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

More
02 Jan 2013 05:29 #28291 by BigJohnT
Replied by BigJohnT on topic Do While problem
I see why the o301 while loop never ends, your looking for an equal condition when one can never happen with 1.0 as the cut depth and 3.5 as the depth to cut.

Sorry it took so long but I only have a couple of minutes between parts on the mill. (yea I'm working today)

John

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

More
02 Jan 2013 22:47 #28310 by tricky-dicky1945
Replied by tricky-dicky1945 on topic Do While problem
Thanks a lot for your help John. The actual fault was that I was testing a negative value against a positive value. Silly I recognized the problem on the Z code but forgot it on the Y part of the code. Software is now running as it should with a tweak to ensure that I never climb mill whilst facing the top. Your help with the use of "Debug" and "Break" made all of the difference. Whilst the faults were a pain it was a useful excersise in programming Gcode. for the mill, I learnt a lot.
Thanks again

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

More
02 Jan 2013 23:10 #28313 by BigJohnT
Replied by BigJohnT on topic Do While problem
Glad you got it sorted out.

Now you can take a tested subroutine and add it to ngcgui with a slight change to the variables. This will allow you to fill in the blanks for each subroutine and concatenate them into a complete program.

John

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

Time to create page: 0.115 seconds
Powered by Kunena Forum