Hi All
After a hiatus, I'm back working on my new lathe. Having done some setup on the bench in Linuxcnc, I am now working on moving various functions into PP.
One thing I'm looking to do is add some external controls - in addition to the software controls. I can get either the external control, or the on-screen buttons to work. But not both together. Any help would be appreciated
Looking in the UI file - it appears PP looks at tormach.coolant-iocontrol
Code:
def on_coolant_button_release_event(self, widget, data=None):
# POSTGUI_HALFILE contains:
# net coolant-flood tormach.coolant => parport.0.pin-14-out
# net coolant-flood-io iocontrol.0.coolant-flood => tormach.coolant-iocontrol
# The UI code here watches tormach.coolant-iocontrol for changes from LinuxCNC.
# See the periodic handler for details
if not self.is_button_permitted(widget): return
self.window.set_focus(None)
# disable coolant lockout : if user commands coolant, do it immediately
self.coolant_lockout = 0
# use our tormach.coolant HAL pin to track actual coolant state
coolant_on = self.hal['coolant']
if not coolant_on:
self.hal['coolant'] = 1
else:
self.hal['coolant'] = 0
In the postgui file I have the following. The last two line are the original PP code. As shown, the code switches my coolant relay with the external switch but on-screen does not work. If I uncomment the original code - it complains about more than one pin being connected to the signal.
Code:
#coolant toggle section#
loadrt toggle2nist count=1
loadrt edge count=1
addf toggle2nist.0 servo-thread
addf edge.0 servo-thread
net coolant-flood <= iocontrol.0.coolant-flood
# Coolant switch
net flood-button <= hm2_7i76e.0.7i76.0.0.input-06 => edge.0.in
net button-edge <= edge.0.out => toggle2nist.0.in
net flood-on <= toggle2nist.0.on => halui.flood.on
net flood-off <= toggle2nist.0.off => halui.flood.off
net flood-control <= halui.flood.is-on => toggle2nist.0.is-on
#original tormach code below here
#net coolant-flood tormach.coolant
#net coolant-flood-io iocontrol.0.coolant-flood => tormach.coolant-iocont
Any ideas would be much appreciated.
Thanks
Dave