Reload Program Through Pin

More
11 years 2 months ago #61904 by andypugh
Replied by andypugh on topic Reload Program Through Pin

Delron wrote: No, I understand how hal is loaded. I thought maybe the axis.remote command could be hooked to a net and input like a function.


That's what my Python component does. It is a HAL wrapper for the command line instruction.

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

More
11 years 2 months ago #61905 by Delron
Replied by Delron on topic Reload Program Through Pin

andypugh wrote:

Delron wrote: No, I understand how hal is loaded. I thought maybe the axis.remote command could be hooked to a net and input like a function.


That's what my Python component does. It is a HAL wrapper for the command line instruction.


You know, I should have known that already after you wrote that component. My brain is so tired that it just does not think right all the time. It was a silly question. Sorry.

I still have to see if that Python script works for me. Will be working on it tonight or tomorrow. Thanks again.

Would I be correct in assuming most users simply use the keyboard and mouse to touch-off? I feel like I'm forging my way down a path few others dare. I would have assumed most everybody would want to touch-off via a pendant and not have to manually refresh the corridinate system with the keyboard/mouse to avoid a possible "Outside machine limits" error?

In any case, I will one day figure this out.
I did have a partial working solution by having HAL invoke "haul.mode.mdi" before running the below M-code. It refreshes the program just fine, but then it's stuck in MDI mode and I can't get back to manual mode without hitting another button.

***machine.ini***
# MDI command #5 --Test of New z-probe with Program Reload--
MDI_COMMAND = M101


***custom.hal***
net touchoff halui.mode.mdi halui.mdi-command-05 <= matrix_kb.0.key.r1c4


***M101***
#!/bin/sh
axis-remote -m "o100 call"
axis-remote —reload &
exit 0


***o100***
<pre>
o100 sub
( Set current Z position to 0 so that we will always be moving down )
G10 L20 P0 Z0
( Probe to Z-1.0 at F5 [Uses machine units, I work in inches, this is meant to be slow!] )
G38.2 Z-1.0 f5
( Set Z0 at point where probe triggers with offset of +0.963 [thickness of PCB plate. You must adjust this for your plate / setup] )
G10 L20 P0 Z0.963
( Rapid up to Z1 above the material )
G0 Z2
o100 endsub
</pre>

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

More
10 years 6 months ago #72745 by bogie6040
Sorry to poke an old thread but....

@Delron I am looking to do the same thing, did you ever get yours to work??

@Andy I tried to implement the script you posted in the axis sim with a pyvcp panel and I keep getting the following no matter what I try:
HAL: ERROR: function 'update' not found
test_postgui.hal:2: addf failed

test_postgui.hal file has:

loadusr update
addf update.trigger servo-thread
net jake-update-backplot update.trigger <= pyvcp.update-button

I placed the newly created file in /usr/bin with all permissions and executable.
I am running Wheezy 2.7.4
What am I doing wrong / missing??

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

More
10 years 6 months ago #72747 by andypugh
Replied by andypugh on topic Reload Program Through Pin

bogie6040 wrote: @Andy I tried to implement the script you posted in the axis sim with a pyvcp panel and I keep getting the following no matter what I try:
HAL: ERROR: function 'update' not found
test_postgui.hal:2: addf failed


Where did you save the file? (ie, the Python file here: forum.linuxcnc.org/forum/21-axis/29552-r...h-pin?start=20#61763 )

linuxcnc.org/docs/2.7/html/hal/halmodule.html

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

More
10 years 6 months ago #72794 by bogie6040
andy wrote:

Where did you save the file? (ie, the Python file here:

I placed the newly created file in /usr/bin with all permissions and executable.

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

More
10 years 6 months ago - 10 years 6 months ago #72797 by andypugh
Replied by andypugh on topic Reload Program Through Pin
Does it run from the command line?

Is it possible that the #! does not point to your version of Python?
Last edit: 10 years 6 months ago by andypugh.

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

Time to create page: 0.350 seconds
Powered by Kunena Forum