O word in program - AXIS hang on program load

More
17 Jun 2012 08:50 #21031 by boyzo
Hello,

I am using LinuxCNC 2.5.0. If I put any O word into the CNC program (do, while, if) computer hang with 100% CPU durring program load (also reload). Then I go to Linux task manager and cancel axis process. I expect that complete emc will end, but no, all works fine after that (I see axis process in task list). I have the same situation on two HP machines, bit it works on another no-name computer with the same configuration, done with pncconf).

Please suggest.


Regards Bojan

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

More
17 Jun 2012 09:40 #21032 by ArcEye
Hi

You will have to post some code that does this on your machine.

Axis reads the file on loading and normally "hanging" is simply that there is a conditional loop that is never satisfied.

regards

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

More
17 Jun 2012 13:52 #21035 by boyzo
Hi,

Yes, I did this intentionally, as I want to repeat program all the time. Is there any other way to start again from the beginning?

One more question: Is there possible to trigger Run, Stop, Pause and Resume with input signals? By keyboard simulation?

Thank you very much for help.
Regards Bojan

Here is my test program that produce a loop:

(Mill 5 diagonal shapes)
o100 do
G91 (Incremental mode)
o103 repeat [5]
M66 P0 L3 Q2
G0 X1 Y1 (diagonal move to next position)
o103 endrepeat
G90 (Absolute mode)
o100 while [1 EQ 1]
M30

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

More
17 Jun 2012 14:15 #21036 by ArcEye
Hi

Yes, I did this intentionally, as I want to repeat program all the time

You will probably have to explain that one a bit more.
No one normally wants a g-code program to run forever, just until the work it is designed for is done.

One more question: Is there possible to trigger Run, Stop, Pause and Resume with input signals?

Have a look at halui esp. halui.program
linuxcnc.org/docs/2.5/html/gui/halui.html

Also man axis-remote for reload of current file.

regards

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

More
17 Jun 2012 14:54 #21037 by boyzo
Hi,

The g-code really needs to repeat forever (until somebody stop it) as parts are changed automatically. In our INDEX lathe this is accomplish by pressing F12 and it repeats until F12 again. No need to code anything in the user CNC program.

Thanks for hint on halgui. I think I will not have any problem implementing it.
Regards Bojan

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

More
17 Jun 2012 15:22 - 17 Jun 2012 15:25 #21039 by ArcEye
Hi

The g-code really needs to repeat forever

Having a sub-routine containing a loop which never ends is not good practice, because it just means that it never leaves that sub-routine.

In this case you just need to structure your overall coding so that the conditional element is at a higher level, ie the level which decides if it will run the program all over again.
The g code does not need to run forever, it just needs to be repeated and make another part until interrupted.

halui should give you the tools to start, stop, pause resume the currently loaded file.
axis-remote will load another file or re-load the current one (the man file is for some reason wrong and has been for some time. Run axis-remote -help for all options)

A User M code file could be used to check for an input or a flag etc and based upon this either rewind and start again or abort.

The operator can still manually pause / stop at any time from the axis interface

good luck
Last edit: 17 Jun 2012 15:25 by ArcEye.

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

More
17 Jun 2012 15:30 #21040 by andypugh
boyzo wrote:

Yes, I did this intentionally, as I want to repeat program all the time.


Pressing "ESC" will stop the preview, which is probably a bit easier than killing the process.

You ought to be able to use a "magic comment" to stop the preview at a chosen location.

(Mill 5 diagonal shapes)
o100 do
G91 (Incremental mode)
o103 repeat [5]
M66 P0 L3 Q2
G0 X1 Y1 (diagonal move to next position)
o103 endrepeat
G90 (Absolute mode)
(AXIS,stop)
o100 while [1 EQ 1]
M30

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

More
17 Jun 2012 15:45 #21043 by BigJohnT
You might try turning off the Axis preview which will try and draw forever the never ending loop...

John

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

More
19 Jun 2012 12:15 #21091 by boyzo
Hello,

Thank you all for help with this. I use (AXIS,stop) to stop preview.

Is this request (I mean to repeat execution of single program) worth thinking about solving it on the external level not in the CNC program?

Regards

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

More
19 Jun 2012 12:20 #21093 by BigJohnT
I would assume the only reason you need to repeat a program is if your changing parts out or have a bar feeder and both of those should be controlled externally from the g code file. When you run out of material you want to stop right? You don't want to start till the new blank or the bar feeder is done right?

Or is this a totally different application? More details on what your trying to do would help.

John

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

Time to create page: 0.101 seconds
Powered by Kunena Forum