How to add ENTER button in macro XHC pendant

More
17 May 2020 17:46 #168078 by Stephanisk
Hi,

I would like to ask the simple question how you write a subroutine o<presenter> sub

I want to add that to one of the macro keys on my xhc pendant to not have to walk to the computer during a manual tool change.

I hope someone has a simple answer how to make it seem the enter button is pressed on the keyboard by means of an xhc pendant

Thanks

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

More
17 May 2020 20:19 #168087 by fixer
The question is really how to confirm manual tool change remotely.
The answer depends on your configuration and user interface you are using.

The following hal example should get you started:
#based on axis_manualtoolchange.hal

loadusr -W hal_manualtoolchange

# in case they were linked already
unlinkp iocontrol.0.tool-change
unlinkp iocontrol.0.tool-changed

net tool-change hal_manualtoolchange.change iocontrol.0.tool-change 
net tool-changed hal_manualtoolchange.changed iocontrol.0.tool-changed
net tool-prep-number hal_manualtoolchange.number iocontrol.0.tool-prep-number

#change XHC.BUTTON to the pin name of your preferred button on the pendant
net change_button hal_manualtoolchange.change_button XHC.BUTTON

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

More
17 May 2020 23:27 #168095 by Stephanisk
Hi fixer,

Thanks for this, but you are taking it a step to far. I am already using the manual tool change script with auto touchoff. That works perfectly. There is just a dialog box that pops up on toolchange and requires pressing enter to continue the script. I want to keep that dialog box I just want to be able to press enter aswell on my pendant instead of my keyboard .

So that is what I am looking for. A code to simulate like you really just press enter on the keyboard but that in one of the macro keys.

Any idea how I do that?

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

More
18 May 2020 04:23 #168110 by fixer
Have you even tried to run my hal? It will do exactly this. It will show dialog to ask for a tool, and it will hide the dialog when you press the button on the pendant. You can still hide the dialog with enter or click on ok as before.

If your config does not use hal_manualtoolchange you will need to post relevant hal and ini sections, so we can find a better solution.

If you insist of pressing the enter key, it is possible to write a userspace python component that simulates keypress with "uinput" module. But this is not the right way to do it

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

More
18 May 2020 22:44 #168201 by Stephanisk
Hi,

Ok, I will try your code. I thought it was way further than what I needed. But I will try it so i can give you the feedback if my system is set up as you think it is.

I will let you know soon.

Thx for the help already

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

More
19 May 2020 00:59 #168219 by MovT
I am interested in the test result too.

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

More
19 May 2020 10:47 #168248 by Stephanisk
One more thing unclear

The xhc.button you refer to the pin name. But the names I have in layout2.inc is macro-7

This is connected
Macro-7 = halui.mdi.command-17

So what do I put than in the mdi-command. Or if I remove the halui.mdi.command-17 what do I write in the place?

Stephane

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

More
19 May 2020 20:16 #168296 by fixer
now it would be a good time to post your config,

try with this hal command:
net pdnt.macro-7 hal_manualtoolchange.change_button

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

More
19 May 2020 22:39 #168312 by Stephanisk
Don't have the config here at hand. It's 00.30 here. It's the basic layout of the XHC pendant code for linuxcnc though.

I will try this tomorrow. But still unclear or what to set in the layout2.inc

What do I write after the macro-7?

Now it has :
Macro-7 = halui.mdi.command-17

So do I make it simply:
Macro-7 =""
Or
Macro-7

Or just delete it in the layout2.inc

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

More
20 May 2020 17:14 #168391 by Stephanisk
Thanks for your help, i got the whole thing to work seeminglessly.

The answer was easier even than i thought, and based on the comments you gave me.

I had to indeed couple the pin xhc-bt4.button-macro-7 to the hal_manualtoolchange.change_button but i didnt have to make a new signal.

So in the layout2.inc i had to write following:

macro-7 = hal_manualtoolchange.change_button

So the whole thing was done with this command, ofcourse if you are as you said using hal.manualtoolchange.

Thanks a lot for the help

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

Time to create page: 0.096 seconds
Powered by Kunena Forum