Control overrides from two sources?

More
20 Dec 2022 17:10 #259967 by spumco
[LCNC 2.9]

New control panel built and I'd like to have two input sources to adjust/control my FRO and SRO.

First source - basic selector switch and an encoder.  Selector can select an axis (for jogging) or SRO/FRO so the encoder can perform dual function.  This method is currently set up in hal and was copied from a working example found on the forum.
# FRO - MPG
setp halui.feed-override.direct-value false
setp halui.feed-override.scale .01
net fo-enable               => halui.feed-override.count-enable
net axis-selected-count     => halui.feed-override.counts

Second source - I'd also like a set of Haas-style override pushbuttons with +10%, -10%, and 100% (reset) functions available.

Problem I could use some guidance on is that using the MPG/encoder requires halui.feed-override.direct-value to be false.  But having direct value buttons with a different scale - halui.feed-override.decrease - seems to be not compatible as it requires direct-value to be true.

Is there some way in HAL to have both input types work? Or do I need something - maybe in Classic Ladder - to change the .direct-value pin from  true to false depending on whether the MPG selector switch is on FRO?

 

Please Log in or Create an account to join the conversation.

More
20 Dec 2022 21:18 #259979 by spumco
Brain working overtime... I think the following will work.
#FEED OVERRIDE BUTTONS & MPG
setp mux2.1.in0         0.1                                     #PUSHBUTTON SCALE
setp mux2.1.in1         0.01                                    #MPG SCALE
setp mux2.2.in0         1.0                                     #MPG DESELECTED
setp mux2.2.in1         0.0                                     #MPG SELECTED
net BTN-FRO-RESET       =>  halui.feed-override.reset           #PUSHBUTTON RESET
net FRO-SELECT          =>  halui.feed-override.count-enable    #MPG SELECTED
net axis-selected-count =>  halui.feed-override.counts          #MPG ENCODER
net FRO-SELECT          =>  mux2.1.sel                          #SELECT FROM PUSHBUTTON OR MPG SCALE BASED ON SWITCH POS
net FRO-SCALE           <=  mux2.1.out
net FRO-SCALE           =>  halui.feed-override.scale
net FRO-SELECT          =>  mux2.2.sel                          #DIRECT-VALUE BASED ON SWITCH POS
net FRO-MPG-ENABLE      <=  mux2.2.out
net FRO-MPG-ENABLE      =>  halui.feed-override.direct-value    #MPG SELECTED DRIVES SIGNAL FALSE
net BTN-FRO-DEC         =>  halui.feed-override.decrease        #PUSHBUTTON -10%
net BTN-FRO-INC         =>  halui.feed-override.increase        #PUSHBUTTON +10%
net FRO-VALUE-OUT       <=  halui.feed-override.value           #LED INDICATOR LOGIC OUTPUT

Shall test and report back.

Please Log in or Create an account to join the conversation.

Time to create page: 0.216 seconds
Powered by Kunena Forum