Jog scale

More
11 Aug 2010 02:51 #3680 by aike
Jog scale was created by aike
Hi!
I want to create JOG scale switch. For example (using pyvcp)
<radiobutton>
<choices>["1","10","100"]</choices>
<halpin>"jog-scale"</halpin>
</radiobutton>

In HAL the pin pyvcp.jog-scale.1, pyvcp.jog-scale.10 and pyvcp.jog-scale.100 wiil be BIT = TRUE every time I select one of this item.
Then I need to assign the halui.jog-spped to 10, 100 and 1000 according to jog-scale value.
How can I do it?
The halui.jog-speed is FLOAT type, but pyvcp.jog-scale values are BIT type.
Is there any logical condition like if then else in HAL?

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

More
11 Aug 2010 04:30 #3682 by cmorley
Replied by cmorley on topic Re:Jog scale
feed the jog buttons into a mux component.. mux8 will convert the three bit inputs to user selectable float values

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

More
11 Aug 2010 08:40 - 11 Aug 2010 08:41 #3687 by aike
Replied by aike on topic Re:Jog scale
Hi!
Where is the manual about mux8?
Last edit: 11 Aug 2010 08:41 by aike.

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

More
11 Aug 2010 09:43 #3689 by andypugh
Replied by andypugh on topic Re:Jog scale
I always use this page, the HAL components are all listed about half way down.

www.linuxcnc.org/docview/html/

specifically mux8 is
www.linuxcnc.org/docview/html//man/man9/mux8.9.html

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

More
11 Aug 2010 13:52 #3702 by aike
Replied by aike on topic Re:Jog scale
Here is the HAL code using mux8
The sel0 - sel2 toggles, but out = 0
What is wrong?
#############################
loadrt mux8

setp mux8.0.in0 1.00
setp mux8.0.in1 2.00
setp mux8.0.in2 3.00
setp mux8.0.in3 4.00
setp mux8.0.in4 5.00
setp mux8.0.in5 6.00
setp mux8.0.in6 7.00
setp mux8.0.in7 8.00

net scale-1 <= pyvcp.jog-scale.1 => mux8.0.sel0
net scale-10 <= pyvcp.jog-scale.10 => mux8.0.sel1
net scale-100 <= pyvcp.jog-scale.100 => mux8.0.sel2
##############################
I'm see in HAL preferences the flashing sel0 - sel2 when i presses the button
But out = 0 every time

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

More
11 Aug 2010 13:59 #3703 by andypugh
Replied by andypugh on topic Re:Jog scale
You need to addf the mux8 to a thread or it won't run. (servo thread is the one to use)

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

More
12 Aug 2010 00:23 #3715 by aike
Replied by aike on topic Re:Jog scale
Thank you
Added "addf" all works now.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum