JR1050 wrote:I get no output,and this makes sense as according to the manual,an output pin cant have a signal attached to it.
So,I have considered trying to "or" them together in hal although I prefer logic in comp files and Im not sure it will work.
In that case, simply create an extra input pin in buttonlogic, and then use logic in there to set the buttonlogic .0.sl-collet-open output pin if either is true.
(possibly also checking that another pin, linked to a spindle speed detector, is false)
As for creating a user pin in the source,There are a bunch of unused common M codes,M21-M40 that if there was some code that basically said "when I see M31 in a g code file,I will execute the code that M31 points to",it could be a comp or userspace thing.
This is already possible in the development branch.
www.linuxcnc.org/docs/devel/html/remap/structure.html
There is an awful lot of power there, though, and it isn't trivial. That might be what you want, but there my also be simpler ways.
I would like to see some sort of executeable Mcode file that can be attached to a thread that has free Mcodes available to be defined for whatever funtions,they would interact with hal just as a comp does.
You seem to be mixing a number of separate concepts there. If you are saying you want code to execute when a HAL pin changes, then you can do that with the MDI_COMMAND INI file option. (and MDI_COMMAND can call an O-word sub, or a custom M-code)
www.linuxcnc.org/docview/html/config/ini..._sub_halui_section_a
pin in m31
pin in m32
If you want to control HAL pins direct from G-code, then look at M66 and friends.
Alternatively, if you want to alter the value of HAL pins with custom M-codes, then you have already seen how to do that (for the M100-M199 codes)
I noticed that user mcodes can be written in csh,what are the limitations of importing signals from hal,will it work more like comp?
Again, I am not clear on quite what you are asking, but M100-M199 will run any executable file. If the file is a shell script then it can access HAL state through the halcmd interface. It can also use axis-remote to manipulate Axis, or linuxcncrsh to control a second, remote, linuxcnc installation over the network (
linuxcnc.org/docs/html/man/man1/linuxcncrsh.1.html)
This probably still works too, though the file might have changed name:
www.mailinglistarchive.com/html/emc-user...009-12/msg00461.html
If the executable file is Python or C then it needs to import various libraries, and it can interact in any way you fancy with the rest of LinuxCNC just like nay other module of the software can.
With LinuxCNC there are more ways to skin cats than they have lives. I am not sure this is a good thing, metaphorically or literally.