lucky phil wrote: I would like to use the panel buttons as I can simply click the mouse any time to operate, if I cant find a workaround or the exact code in the right place a three position switch might have to do.
There is no point hard-wiring it, my 3-way switches operate in HAL. However I have plenty of IO to interface them with.
You already have:
Code:
net coolant-mist => parport.0.pin-14-out
net coolant-flood => parport.0.pin-16-out
That creates two signals (coolant-mist, coolant-flood) and connects them to parport pins. Keep that but remove any other lines using those signals.
I have just remembered that the normal mux4 does not handle bit signals. This was probably your problem. We will use mux-generic.
Now, in the postGUI hal file (and after making sure that the postgui HAL file is mentioned in the [HAL] section of the INI file add this.
Code:
loadrt mux_generic config="bb4,bb4"
#This line prints out the actual names of the mux pins, just in case
show pin mux-*
addf mux-gen.00 servo-thread
addf mux-gen.01 servo-thread
net flood-manual-off pyvcp.flood-manual-off => mux-gen.01.sel-bit-00
net flood-manual-on pyvcp.flood-manual-on => mux-gen.01.sel-bit-01
net mist-manual-off pyvcp.mist-manual-off => mux-gen.01.sel-bit-00
net mist-manual-on pyvcp.mist-manual-on =>mux-gen.01.sel-bit-01
net flood-auto iocontrol.0.coolant.flood => mux-gen.00.in-bit-00
setp mux-gen.00.in-bit-01 0
setp mux-gen.00.in-bit-01 1
setp mux-gen.00.in-bit-03 0
net coolant-flood <= mux-gen.00.out-bit
net mist-auto iocontrol.0.coolant.mist => mux-gen.01.in-bit-00
setp mux-gen.01.in-bit-01 0
setp mux-gen.01.in-bit-01 1
setp mux-gen.01.in-bit-03 0
net coolant-mist <= mux-gen.01.out-bit
I have not tested this, I am some distance from my LinuxCNC machine