Stop program from M-Code

More
28 Jun 2018 09:08 #112978 by andypugh
Replied by andypugh on topic Stop program from M-Code
I was testing with 2.8pre on a development machine.

Do you get the error while the code is running or as soon as you open the file?

(I was getting it when the file was opened and whenever it was refreshed after running, but not if refreshed without trying to run)

What happens if you start LinuxCNC splash G-code running and then run the script from the terminal?

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

More
28 Jun 2018 17:23 #113002 by ciccio85
Replied by ciccio85 on topic Stop program from M-Code
I get the error as soon as the halcmd command is executed. It does not matter if it executed from the M code or from the terminal. Maybe you can try with my configuration: github.com/FrancescoTalotta/linuxcnc

Thank you

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

More
28 Jun 2018 17:29 - 28 Jun 2018 17:29 #113004 by andypugh
Replied by andypugh on topic Stop program from M-Code
Your USER_M_CODE path is wrong, could it be that?
Last edit: 28 Jun 2018 17:29 by andypugh.

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

More
28 Jun 2018 17:42 #113007 by ciccio85
Replied by ciccio85 on topic Stop program from M-Code
My USER M CODE path is should be ok. My M codes are in that folder and they work. If it really is wrong please tell me why. Maybe is this the problem.

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

More
28 Jun 2018 17:44 #113008 by nkp
Replied by nkp on topic Stop program from M-Code
can the problem be here:
ngc = /home/ciccio/linuxcnc/configs/3040t_no-endstops/python_post_processors/Z_tool_offset.py

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

More
28 Jun 2018 18:11 #113009 by ciccio85
Replied by ciccio85 on topic Stop program from M-Code
This is a postprocessor I use to add some other G code but I don't think is this the problem

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

More
28 Jun 2018 18:14 - 28 Jun 2018 18:15 #113010 by nkp
Replied by nkp on topic Stop program from M-Code
I assume that without the postprocessor, the code M111 will be executed correctly
Last edit: 28 Jun 2018 18:15 by nkp.

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

More
28 Jun 2018 18:30 #113011 by ciccio85
Replied by ciccio85 on topic Stop program from M-Code
I just tried without postprocessor, but again the same error. The postprocessor actually only adds some G code but when the M111 is executed I get the error.

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

More
28 Jun 2018 19:22 - 28 Jun 2018 19:23 #113012 by dgarrett
Replied by dgarrett on topic Stop program from M-Code
your github file:
github.com/FrancescoTalotta/linuxcnc/blob/master/M-codes/M111
for M111 says:
...
case $? in
    0)halcmd setp halui.program.run True; sleep 3; halcmd setp halui.program.run False
    ;;
esac
...

e.g, it is using halui.program.run where you intend halui.program.stop
as indicated in this earlier post:
forum.linuxcnc.org/10-advanced-configura...?limitstart=0#112859

That post says:
...
case $? in
    0)sleep 2; halcmd setp halui.program.stop True
    ;;
esac
...

That code does not ensure that halui.program.stop is returned to
the unasserted (False) state (but it should using an appropriate
sleep delay).
Last edit: 28 Jun 2018 19:23 by dgarrett.

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

More
28 Jun 2018 19:37 #113013 by ciccio85
Replied by ciccio85 on topic Stop program from M-Code
Hello,

yes sorry this was from an old snapshot. Now I'm running this M111 code:
#!/bin/bash

(sleep 1 && wmctrl -F -a "Probe" -b add,above) &
yad --title "Probe" --image=/home/ciccio/linuxcnc/configs/10060_4th/M-codes/qs.png --geometry="290x120" --text="<big>Hai fatto il probe? Hai posizionato il mandrino in un punto dove poter cambiare l'utensile?</big>" --button="STOP" --button="Continua"

case $? in
    0)sleep 3; halcmd setp halui.program.stop True

     sleep 6;
    ;;
esac
exit 0

But still does not work... :(

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

Time to create page: 0.129 seconds
Powered by Kunena Forum