Remap M3 - how to access HAL pin/param values
- chowderhead
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 11
28 Jan 2023 18:53 #263106
by chowderhead
Remap M3 - how to access HAL pin/param values was created by chowderhead
I'm using LinuxCNC to control a robotic welding cell. I've highjacked spindle controls to start/stop welding power using M3/M5. It works great with MIG, now I want to use TIG. My welder only supports TIG touch start, so I would like to remap M3 to first call G38.2 to touch the tungsten to the work piece, then fire M3 to activate power, followed by G1 Znn to lift the electrode off the piece prior to continuing the weld path dictated by my ngc file. I have a user space HAL control for communicating with the robotic welder, and I need to access HAL pins in that component to turn the welder's touch sense on and off. I would like to do all of this in pure Python, but I've run my head against the wall trying to figure out how to access HAL pins in my user space component.
I see named parameters can be called very simply (e.g., sim/remap/extend-builtins), but I can find no similar way to do so with HAL pins. There seems to be no documentation on the interpreter python module, and I'm not seeing anything obvious in the rs274 interp code. Am I missing something, or asking the impossible?
Thanks!
I see named parameters can be called very simply (e.g., sim/remap/extend-builtins), but I can find no similar way to do so with HAL pins. There seems to be no documentation on the interpreter python module, and I'm not seeing anything obvious in the rs274 interp code. Am I missing something, or asking the impossible?
Thanks!
Please Log in or Create an account to join the conversation.
28 Jan 2023 19:36 - 28 Jan 2023 19:45 #263107
by Aciera
Replied by Aciera on topic Remap M3 - how to access HAL pin/param values
try
linuxcnc.org/docs/html/hal/halmodule.html#_set_p
linuxcnc.org/docs/html/hal/halmodule.html#_get_value
edit:
Looks like it might be as simple as:
linuxcnc.org/docs/html/hal/halmodule.html#_set_p
linuxcnc.org/docs/html/hal/halmodule.html#_get_value
edit:
Looks like it might be as simple as:
h['out'] = h['in']
Last edit: 28 Jan 2023 19:45 by Aciera.
The following user(s) said Thank You: chowderhead
Please Log in or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 11
28 Jan 2023 22:52 #263129
by chowderhead
Replied by chowderhead on topic Remap M3 - how to access HAL pin/param values
Well, that's humbling. I didn't even think of looking at the hal module. Duh!
Thank you!
Thank you!
Please Log in or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 11
01 Feb 2023 20:06 #263461
by chowderhead
Replied by chowderhead on topic Remap M3 - how to access HAL pin/param values
Note M3 is not eligible for remapping. Used a custom M-code instead...
Please Log in or Create an account to join the conversation.
04 Feb 2023 10:31 #263653
by andypugh
Replied by andypugh on topic Remap M3 - how to access HAL pin/param values
You can, however, remap S. So possibly you could use M3 S1 to touch-start and then M3 S2 to weld? (Or use S to set the current)
The following user(s) said Thank You: chowderhead
Please Log in or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 11
05 Feb 2023 15:22 #263752
by chowderhead
Replied by chowderhead on topic Remap M3 - how to access HAL pin/param values
Ah, that is an excellent suggestion! I'll explore that one. Thank you.
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds