O word in program - AXIS hang on program load
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.
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.
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.
You will probably have to explain that one a bit more.Yes, I did this intentionally, as I want to repeat program all the time
No one normally wants a g-code program to run forever, just until the work it is designed for is done.
Have a look at halui esp. halui.programOne more question: Is there possible to trigger Run, Stop, Pause and Resume with input signals?
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.
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.
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.The g-code really needs to repeat forever
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
Please Log in or Create an account to join the conversation.
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.
John
Please Log in or Create an account to join the conversation.
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.
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.