Touch-off via HAL button in AXIS...almost!

More
03 Jan 2020 22:51 #153931 by pferrick
Hi all-

I have successfully triggered an MDI command (G10 L20 P1 X0 Y0 Z0) via a HAL button, which I'm intending to use as a workpiece touch-off.

When it happens, the G54 offsets become equal to the current machine coordinates. But the overall effect is not quite the same as pushing the 'touch off' buttons in AXIS and entering 0 for X, Y and Z. Doing that redraws the toolpath with the tool icon (the white cone) over the (0,0,0) point in the coordinate system of the part....the above code repositions the origin just fine, but for some reason AXIS doesn't redraw the toolpath in the updated position.

Any hints would be appreciated!
Thanks,
Patrick

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

More
04 Jan 2020 00:20 #153936 by cmorley
Unfortunately linuxcnc doesn't send a command to the gui to redraw when you use G10 - you must expressly ask AXIS to reload.

typically axis-remote is used to do this - are you using gladevcp? there is a thread od a few days ago on how to do this:

forum.linuxcnc.org/48-gladevcp/38063-com...p-button-call-python

Chris M
The following user(s) said Thank You: pferrick

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

More
04 Jan 2020 03:44 #153953 by pferrick
Thanks for the quick response, Chris. Yes, I am running gladevcp and I think I recall playing around with axis-remote for one reason or the other.

Would it be something along the lines of this python:

import sys
import linuxcnc

c = linuxcnc.command ()
c.program_open("axis-remote --mdi G10 L20 P1 X0 Y0 Z0")
c.program_open("axis-remote --reload")

which would be called by a gladevcp button?

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

More
04 Jan 2020 03:59 #153959 by cmorley
The axis remote commands are fine but c.open program only opens gcode related programs
If you look at the thread link I posted the answer is there - assuming you are using gladevcp with a python handler file.

In general you connect a gladevcp button to call a function in a python handler file to do what ever you want such as touch off and reload.

Depending on what version of linuxcnc you are using there could be other options but gladevcp is the most tested way.

Chris

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

Time to create page: 0.253 seconds
Powered by Kunena Forum