- Posts: 136
- Thank you received: 0
keystroke as a hal pin?
I'm wondering if is possible to assign a keyboard keystroke as an HAL pin? My objective is to use 3 keys, witch one will call a subroutine.
the first will open a log file, the second to log the X and Y coordinates, and finally the third to close the log file. If I can use this with the present keyboard keys it will be great.
Thanks
Please Log in to join the conversation.
Gmoccapy or Gscreen are easier to add this to then AXIS
Chris M
Please Log in to join the conversation.
I prefer a solution that don't depends on the screen. The machine has already a custom panel on axis, and do the complete migration will involve some work...
Please Log in to join the conversation.
If you wish to use some other external buttons then it can be outside of the running screen.
That being said it is not impossible with AXIS it's just not many people know it well enough - including me.
Chris M
Please Log in to join the conversation.
www.linuxcnc.org/index.php/english/forum...gging?start=10#62208
and seeing the axis.py file
I add to my ini file configuration on the display area:
and the keystroke.py contains this code:
so, at this point, if I have some mdi command on the "buffer"
Attachment not found
but I cant find any "commands.send_mdi" that have a string as an argument. or a way to write on the "buffer".
João
Please Log in to join the conversation.
jtc wrote: but I cant find any "commands.send_mdi" that have a string as an argument. or a way to write on the "buffer".
Does this help?
www.linuxcnc.org/docs/html/config/python-interface.html
Please Log in to join the conversation.
andypugh wrote:
jtc wrote: but I cant find any "commands.send_mdi" that have a string as an argument. or a way to write on the "buffer".
Does this help?
www.linuxcnc.org/docs/html/config/python-interface.html
I already had seen this link, I tryed to use the following code on my .py file:
hopping to see to be executed on simulation, but without success.
regarding the original idea of the topic, using a keystroke as an hal pin, in axis.py file, next to line 3226 I find this:
that create the axisui pins, but if I changed the name of one of these pins, when start linuxcnc I can´t see any difference in axisui pin names.
So, I'm missing something...
João
Please Log in to join the conversation.
jtc wrote: if ok_for_mdi():
c.mode(linuxcnc.MODE_MDI)
c.wait_complete() # wait until mode switch executed
c.mdi("G0 X10 Y20 Z30")[/code]
That ought to work, it normally does.
Please Log in to join the conversation.
jtc wrote: Hi,
I'm wondering if is possible to assign a keyboard keystroke as an HAL pin? My objective is to use 3 keys, witch one will call a subroutine.
the first will open a log file, the second to log the X and Y coordinates, and finally the third to close the log file. If I can use this with the present keyboard keys it will be great.
Thanks
It is already available as standard in Machinekit, with modifications I added some while ago.
You can assign 10 commands, MDI, HAL or system to the 0 - 9 number keys
See mgware.co.uk/ > Axis Modifications > User Defined Commands to read the details and download the zip.
I have not bothered keeping it current with Linuxcnc versions, but the code should be pretty much unchanged.
regards
Please Log in to join the conversation.
