Feed-Override Value Assign Button

More
13 Feb 2016 13:43 #70057 by bladekel
Hello my friends.
I need to define 4 buttons which will change the value of feed-override.
Such as 1st button will assign the feed-override value to 25, 2nd 50, 3rd 75 and 4th 100...
I could increase or decrease the value by using halui.feed-override.decrease and halui.feed-override.increase.

I think , if i could learn the use of halui.feed-override.direct-value , my problem will be solved.

Can anyone help me ?

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

More
13 Feb 2016 18:57 #70082 by cmorley
Not sure what kind of buttons you wish to use.
If you wish to use real buttons that are _not_ momentary such as a rotary switch or
GLADEVCP radio buttons this should work:
# mux16 is used to select percentage output based on
# bit input patterns - This is named to reflect feed override use
loadrt mux16 names=foincr

must add mux16 to a thread
addf foincr                   servo-thread

# connect feed overide increments - switches
# need to connect the signals to actual swicthes
net fo-incr-button-a           =>  foincr.sel0
net fo-incr-button-b           =>  foincr.sel1
net fo-incr-button-c           =>  foincr.sel2
net fo-incr-button-d           =>  foincr.sel3

# set up and connect halui feedoverride 
    setp halui.feed-override.count-enable true
    setp halui.feed-override.direct-value true
    setp halui.feed-override.scale .01
net feedoverride-incr   =>  halui.feed-override.counts
net feedoverride-incr   <=  foincr.out-s

# set mux16 options and override percentages
    setp foincr.debounce-time      0.200000
    setp foincr.use-graycode      False
    setp foincr.suppress-no-input False
    setp foincr.in00          0.000000
    setp foincr.in01          5.000000
    setp foincr.in02          10.000000
    setp foincr.in04          50.000000
    setp foincr.in08          110.000000

signals fo-incr-button-a etc need to be connected to actual buttons.
The following user(s) said Thank You: bladekel

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

More
16 Feb 2016 16:37 #70243 by bladekel

Not sure what kind of buttons you wish to use.
If you wish to use real buttons that are _not_ momentary such as a rotary switch or
GLADEVCP radio buttons this should work:
# mux16 is used to select percentage output based on
# bit input patterns - This is named to reflect feed override use
loadrt mux16 names=foincr

must add mux16 to a thread
addf foincr                   servo-thread

# connect feed overide increments - switches
# need to connect the signals to actual swicthes
net fo-incr-button-a           =>  foincr.sel0
net fo-incr-button-b           =>  foincr.sel1
net fo-incr-button-c           =>  foincr.sel2
net fo-incr-button-d           =>  foincr.sel3

# set up and connect halui feedoverride 
    setp halui.feed-override.count-enable true
    setp halui.feed-override.direct-value true
    setp halui.feed-override.scale .01
net feedoverride-incr   =>  halui.feed-override.counts
net feedoverride-incr   <=  foincr.out-s

# set mux16 options and override percentages
    setp foincr.debounce-time      0.200000
    setp foincr.use-graycode      False
    setp foincr.suppress-no-input False
    setp foincr.in00          0.000000
    setp foincr.in01          5.000000
    setp foincr.in02          10.000000
    setp foincr.in04          50.000000
    setp foincr.in08          110.000000

signals fo-incr-button-a etc need to be connected to actual buttons.


This is exactly what i need. Thanks dude...

But I want to know / do sth more. As you sad this code is perfect with radio_buttons. I defined 4 buttons like btn1=5,btn2=10,btn3=50,btn4=110. But if i checked except these, the feed-override becomes 0. Is there anyway to make feed-override stay on its last value ?
Such as if i lastly checked on 4th button , fo becomes 110 and after I unchecked 4th button ( assuming 1st,2nd and 3rd buttons are unchecked), can it be stay on 110 ?

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

More
17 Feb 2016 03:12 #70270 by cmorley
see the line:
setp foincr.suppress-no-input False

set it to True

Now when all buttons are false, it will be ignored the output won't change.

Chris M
The following user(s) said Thank You: bladekel

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

More
17 Feb 2016 03:15 #70271 by cmorley
or you could:
setp foincr.in00 0.000000

to something besides zero

Chris M
The following user(s) said Thank You: bladekel

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

More
17 Feb 2016 07:46 #70281 by bladekel

see the line:
setp foincr.suppress-no-input False

set it to True

Now when all buttons are false, it will be ignored the output won't change.

Chris M


Thanks dude. This is it.... So so so so thanks....

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

More
18 Feb 2016 02:29 #70332 by cmorley
Glad I could help.

Chris M

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

Time to create page: 0.062 seconds
Powered by Kunena Forum