Reload Program Through Pin
24 Aug 2015 12:36 #61736
by PCW
Replied by PCW on topic Reload Program Through Pin
Umm cradek on the linuxcnc-dev irc channel pointed out what should have been obvious:
How can you change the manual/mdi mode via M101 since you are running a program
by definition if you are executing a M101...
How can you change the manual/mdi mode via M101 since you are running a program
by definition if you are executing a M101...
Please Log in or Create an account to join the conversation.
24 Aug 2015 20:43 #61743
by Delron
Replied by Delron on topic Reload Program Through Pin
I just don't understand. We are all simply trying to touch-off to a work piece by pressing a button on our pendents. When we do that, we a mostly triggering a sub routine to probe down, and set the working offset. However, Linuxcnc will not refresh the new offset plot in this manner, so we must reload the program.
All the experts say to use a M-Code to do a axis-remote --reload. However, when we all try that, we get errors. Then we ask why, and they say you can't do that while running a m-code????
I have searched the internet for many days on how to solve this simple problem, and it seems that lots of people have given advise, but never really tried it themselves. Zero working examples!
Andy once put it;
Re: [Emc-users] axis-remote in M-call problems
From: andy pugh <bodgesoc@gm...> - 2013-04-09 20:52:52
On 9 April 2013 19:54, Henrik Munktell <henrik.munktell@...> wrote:
> I have a probe function that probes towards the work piece, on contact, I
> set Z pos with "G10 L20". When I do that, the preview plot in axis does not
> update and represent the correct Z height. So I want to do a "axis-remote
> --reload" in the probe routine to refresh the plot
Refreshing the plot is a perfectly natural thing to want to do.
Wanting to reload a _running_program_ is just asking for trouble.
I wish I knew enough Python / tcl to know if it was trivial to add a
"refresh" command to Axis.
All the experts say to use a M-Code to do a axis-remote --reload. However, when we all try that, we get errors. Then we ask why, and they say you can't do that while running a m-code????
I have searched the internet for many days on how to solve this simple problem, and it seems that lots of people have given advise, but never really tried it themselves. Zero working examples!
Andy once put it;
Re: [Emc-users] axis-remote in M-call problems
From: andy pugh <bodgesoc@gm...> - 2013-04-09 20:52:52
On 9 April 2013 19:54, Henrik Munktell <henrik.munktell@...> wrote:
> I have a probe function that probes towards the work piece, on contact, I
> set Z pos with "G10 L20". When I do that, the preview plot in axis does not
> update and represent the correct Z height. So I want to do a "axis-remote
> --reload" in the probe routine to refresh the plot
Refreshing the plot is a perfectly natural thing to want to do.
Wanting to reload a _running_program_ is just asking for trouble.
I wish I knew enough Python / tcl to know if it was trivial to add a
"refresh" command to Axis.
Please Log in or Create an account to join the conversation.
24 Aug 2015 20:54 #61745
by Delron
You know that Strykerg posted this 4 years ago right? I was reviving the thread.
Replied by Delron on topic Reload Program Through Pin
is it possible to reload the current program through a hal pin?
i'm building a sort of pendant which includes a button for touching off the current axis. the touch-off works however unless the program is reloaded the backplot does not reflect the offset properly. and the only solution I found is to reload program .
Starting over, when you press the touch off button on your pendant what is it doing exactly? I assume your not in the middle of a program or are you?
JT
You know that Strykerg posted this 4 years ago right? I was reviving the thread.
Please Log in or Create an account to join the conversation.
25 Aug 2015 02:51 #61752
by BigJohnT
Replied by BigJohnT on topic Reload Program Through Pin
No, I missed that you had hijacked the thread...
JT
JT
Please Log in or Create an account to join the conversation.
25 Aug 2015 02:54 #61753
by Delron
My Apologies.
Did not realize one could "Hijack" a four year old defunct thread.
Replied by Delron on topic Reload Program Through Pin
No, I missed that you had hijacked the thread...
JT
My Apologies.
Did not realize one could "Hijack" a four year old defunct thread.
Please Log in or Create an account to join the conversation.
25 Aug 2015 02:58 #61754
by BigJohnT
Please note that it is not LinuxCNC that is not refreshing the backplot it is Axis that does not know what you do with MDI commands that are run via your pendant. If you don't tell Axis how is it supposed to know?
LinuxCNC has the Python Interface and that is one of the many things that you can do with it.
www.linuxcnc.org/docs/2.7/html/config/python-interface.html
JT
Replied by BigJohnT on topic Reload Program Through Pin
I just don't understand. We are all simply trying to touch-off to a work piece by pressing a button on our pendents. When we do that, we a mostly triggering a sub routine to probe down, and set the working offset. However, Linuxcnc will not refresh the new offset plot in this manner, so we must reload the program.
Please note that it is not LinuxCNC that is not refreshing the backplot it is Axis that does not know what you do with MDI commands that are run via your pendant. If you don't tell Axis how is it supposed to know?
LinuxCNC has the Python Interface and that is one of the many things that you can do with it.
www.linuxcnc.org/docs/2.7/html/config/python-interface.html
JT
Please Log in or Create an account to join the conversation.
25 Aug 2015 03:05 - 25 Aug 2015 03:07 #61757
by Delron
Replied by Delron on topic Reload Program Through Pin
Well I appreciate that there "May" be a way to do what we want with a Python script, I am no programmer. I'm struggling enough wrapping my mind around the HAL interface.
My CNC is just an extension on my woodworking hobby. (Hobby!) I unfortunate do not have time to learn new programming skills, especially just for one simple plot refresh.
I was really hoping to find someone that may have done something to deal with this already and borrow from their work. Make no mistake, I do not "Expect" anyone to hand over their hard work, but some are willing to help others in need sometimes.
Cheers!
My CNC is just an extension on my woodworking hobby. (Hobby!) I unfortunate do not have time to learn new programming skills, especially just for one simple plot refresh.
I was really hoping to find someone that may have done something to deal with this already and borrow from their work. Make no mistake, I do not "Expect" anyone to hand over their hard work, but some are willing to help others in need sometimes.
Cheers!
Last edit: 25 Aug 2015 03:07 by Delron. Reason: mistakes
Please Log in or Create an account to join the conversation.
25 Aug 2015 03:50 #61759
by Delron
Replied by Delron on topic Reload Program Through Pin
Maybe a glimmer of hope? If this is being looked into, if it's not too old and stale.
From
wiki.linuxcnc.org/cgi-bin/wiki.pl?Lncnc_3_Idea_Whiteboard
7.4. Better support for GUI updates, like update messages
It would be nice if linuxcnc had a better system for updating GUI information, such as when to reload the plot, when to update offset display pages, when the user system changes etc
For instance right now if you offset the origin you must explicitly reload the HAL_gremlin graphics plot. That means if we ever have a different plotter it will be broken until one updates the program to reload the new plotter. It would be much better if linuxcnc sent a 'update plot' message every time it moves the origin
Another one is the fact you must switch from MDI to manual to MDI again to get linuxcnc to re-synch the var file.
From
wiki.linuxcnc.org/cgi-bin/wiki.pl?Lncnc_3_Idea_Whiteboard
7.4. Better support for GUI updates, like update messages
It would be nice if linuxcnc had a better system for updating GUI information, such as when to reload the plot, when to update offset display pages, when the user system changes etc
For instance right now if you offset the origin you must explicitly reload the HAL_gremlin graphics plot. That means if we ever have a different plotter it will be broken until one updates the program to reload the new plotter. It would be much better if linuxcnc sent a 'update plot' message every time it moves the origin
Another one is the fact you must switch from MDI to manual to MDI again to get linuxcnc to re-synch the var file.
Please Log in or Create an account to join the conversation.
25 Aug 2015 04:05 #61761
by BigJohnT
Replied by BigJohnT on topic Reload Program Through Pin
That's just a wish list someone posted 2 1/2 years ago for LinuxCNC 3.
JT
JT
Please Log in or Create an account to join the conversation.
25 Aug 2015 04:59 #61763
by andypugh
Replied by andypugh on topic Reload Program Through Pin
I just created a little HAL component that runs the axis-remote reload command when a HAL pin changes fro 0 to 1..
But I am not sure if that does what you want. Clearly reloading a program while it is running has to be a very bad idea.
The backplot display is created by a "dry run" of the G-code through the actual interpreter. It can't do that while the interpreter is busy with a running program.
#!/usr/bin/python
import linuxcnc, hal
import os
h = hal.component("update")
h.newpin("trigger",hal.HAL_BIT, hal.HAL_IN)
c = linuxcnc.command()
h.ready
try:
while 1:
if h.trigger and not old_trigger:
os.system("axis-remote --reload ")
old_trigger = h.trigger
except KeyboardInterrupt:
pass
But I am not sure if that does what you want. Clearly reloading a program while it is running has to be a very bad idea.
The backplot display is created by a "dry run" of the G-code through the actual interpreter. It can't do that while the interpreter is busy with a running program.
Please Log in or Create an account to join the conversation.
Time to create page: 0.122 seconds