Can you post the code that creates the buttons?  I think that's the main issue 
here.  As mentioned before, there are all sorts of G-Code subroutines in the 
nc_files folder but getting away from using the 'command line' so to speak is 
the general idea.

My issue was I have the HB04 Pendant.  I also have in the pyvcp-panel.xml file 
hal pins described.
        <vbox>
        <relief>RIDGE</relief>         
        <bd>6</bd>
                <button>
                        <halpin>"rapid-to-Z-home"</halpin>
                        <text>"Rapid to Z Home"</text> 
                        <font>('Fixed',16)</font>
                </button>  
                <button>
                        <halpin>"rapid-to-XY-home"</halpin>
                        <text>"Rapid to XY Home"</text> 
                        <font>('Fixed',16)</font>
                </button>  
        </vbox>


In the postgui_call_list.hal I had
#net remote-rapid-to-Z-home halui.mdi-command-16 <= pyvcp.rapid-to-Z-home
#net remote-rapid-to-XY-home halui.mdi-command-17 <= pyvcp.rapid-to-XY-home

From what I understood from the documentation I then add two lines
# add halui MDI commands here (max 64)
# MDI_COMMAND = G0 Z0
# MDI_COMMAND = G0 X0 Y0

Which are assigned mdi-command-16 and -17 because the layout2.inc for the HB04 
has 

[HALUI]
# these are examples, edit as required:
# a halui hal pin is created for each MDI_COMMAND below
# halui.mdi-command-00, halui.mdi-command-01,... etc
MDI_COMMAND=G0 X0 Y0 Z0
MDI_COMMAND=(debug, example: mdi-01)
MDI_COMMAND=(debug, example: mdi-02)
#03 M110: clears notifications
...
#15
MDI_COMMAND= G10 L20 P0 C0

However that didn't work.  So I postponed work on that for other stuff.  But I 
would like to get it working and I would like to create a few more buttons.

John


> -----Original Message-----
> From: Les Newell [mailto:les.new...@fastmail.co.uk]
> Sent: July-12-21 8:20 AM
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] 'automatically' go halfway between 2 points
> 
> It's pretty easy to do this in g-code. There is no need to get involved
> with HAL programming.
> Here is one way I do it on my mill. I have buttons for the following:
> Zero X (runs code G92X0)
> Zero Y (runs code G92Y0)
> Zero Z (runs code G92Z0)
> X/2 (runs code G92X[#5420 / 2])
> Y/2 (runs code G92X[#5421 / 2])
> 
> Say I want to find the centre of X. I find one X edge using a probe or
> eyeball as required then zero X. Move to the other side and hit X/2. X0
> is now in the centre.
> If you have an electronic probe this plugin works quite well
> <https://github.com/linuxcnc-probe-screen/probe-screen-ng>.
> 
> Les
> 
> On 12/07/2021 05:29, R C wrote:
> > Hello,
> >
> >
> > in linuxcnc,� is there an easy/automated way to get halfway between
> > two points?�� (Fort example, you'd touch off somewhere, move to some
> > coordinate (x, y)� (or even (x, y, z)) and go inbetween right to the
> > the middle of where you touched off and where the spindle is now?
> >
> >
> > thanks,
> >
> >
> > Ron
> 
> 
> 
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users



_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to