math ops inside hal

More
30 Nov 2011 12:42 - 30 Nov 2011 12:48 #15220 by dab77
math ops inside hal was created by dab77
hallo forum!

can i do some math inside hal?

for example, i have this:
net joy-speed halui.jog-speed <= hidcomp.0.Slider.fvalue

but Slider value goes from -1 to 1 and unfortunately real jog speed goes from -1 to 1 mm/min...

i would like to multiply this value per ..let's say 1000, or mapping the value to 0-1000.

is it possible in some way?

thanks, davide.

p.s. i forgot to say i'm on 2.5
Last edit: 30 Nov 2011 12:48 by dab77.

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

More
30 Nov 2011 13:21 #15222 by andypugh
Replied by andypugh on topic Re:math ops inside hal
dab77 wrote:

net joy-speed halui.jog-speed <= hidcomp.0.Slider.fvalue
but Slider value goes from -1 to 1 and unfortunately real jog speed goes from -1 to 1 mm/min...

Can't you change the range limits of the slider?
Anyway, you need the "scale" HAL component.
www.linuxcnc.org/docview/html/man/man9/scale.9.html
There is also "mult2" but scale has an offset value too.

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

More
30 Nov 2011 14:04 #15224 by dab77
Replied by dab77 on topic Re:math ops inside hal
thanks! it works.
i could do it with hidconfig, but this way i learn some more.
i need other commands into hal, is there a link with the list of all possible commands? i can't find..

thanks!

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

More
30 Nov 2011 14:05 #15225 by dab77

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

Time to create page: 0.117 seconds
Powered by Kunena Forum