- Posts: 60
- Thank you received: 0
Remap M3 - how to access HAL pin/param values
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
3 years 9 months ago #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 to join the conversation.
3 years 9 months ago #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:
Code:
h['out'] = h['in']
Please Log in to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 9 months ago #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 to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 8 months ago #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 to join the conversation.
3 years 8 months ago #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)
Please Log in to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 8 months ago #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 to join the conversation.
Time to create page: 0.088 seconds
