Endless loops. Is it possible? [SOLVED]

More
31 Oct 2013 15:35 - 31 Oct 2013 21:07 #40439 by alberto-g
Hello, I would like to repeat a loop for an unlimited number of times.
My first try has been

o101 while [1]
..
o101 endwhile

but LinuxCNC hangs while loading this code.

Next try:

o103 repeat [10000]
..
0103 endrepeat

thinking I could get away with an almost infinite loop. But loading times are very high.

It seems like it is trying to scan the program until its end, which of course is never reached.
I'm new to CNCs in general, so please forgive me if I'm missing something obvious.

This is on a BeagleBone board, bb-lcnc.blogspot.co.at/p/machinekit_16.html.

Thanks

Alberto
Last edit: 31 Oct 2013 21:07 by alberto-g.

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

More
31 Oct 2013 15:54 #40441 by Rick G

It seems like it is trying to scan the program until its end

Yes, to prepare the plot, check to see if the gcode program is within the working envelope of the machine, check for errors, etc.

Perhaps explain what you are try to do so a different approach my be suggested.

Rick G
The following user(s) said Thank You: alberto-g

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

More
31 Oct 2013 16:03 #40442 by ArcEye
Hi

but LinuxCNC hangs while loading this code.


Linuxcnc does not hang, it is Axis that never gets to the end of its code preview.

You can use a different front end which just displays actual movements or disable the preview

linuxcnc.org/docs/html/gui/axis.html#_axis_preview_control

regards
The following user(s) said Thank You: alberto-g

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

More
31 Oct 2013 16:12 #40443 by alberto-g
Thanks, I will try that.

I would like to use LinuxCNC like a sort of a PLC with a motion card.
I just need to wait for an input, execute some motions, then repeat.
Maybe some other project would be better suited for this task, like having a programming language with more features.

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

More
31 Oct 2013 17:57 #40446 by BigJohnT
LinuxCNC has a built in PLC check out the Classicladder section of the Integrators manual.

JT
The following user(s) said Thank You: alberto-g

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

More
31 Oct 2013 18:25 #40448 by alberto-g
ArcEye was right. (AXIS,stop) did the trick.
Now I'll read about the PLC part. It would be very powerful.

Thank you very much.

(written from the Beaglebone while LinuxCNC is running)

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

Time to create page: 0.068 seconds
Powered by Kunena Forum