Help pls
- drstein99
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
21 Oct 2009 00:15 #1005
by drstein99
Help pls was created by drstein99
I'm having trouble sorting over the lengthy docs can someone please help ?
I've already got everything setup w/ the steppers and got past the external MPG tutorial, so I can use a jog-dial on an axis, which does work. The example unfortunately wants me to use a MUX encoder to toggle between axis and jog resolutions.
What I want to do, is assign a push-button to select the MPG jog resolution (.1, .01, and .001) - and another pushbutton to assign the axis (x, y, or Z). So, it would default to the first value, and each time I push the button it iterates thru the list looping back to the first.
Is there an example somewhere or can someone help me figure out how to do this please/? Thanks.
I've already got everything setup w/ the steppers and got past the external MPG tutorial, so I can use a jog-dial on an axis, which does work. The example unfortunately wants me to use a MUX encoder to toggle between axis and jog resolutions.
What I want to do, is assign a push-button to select the MPG jog resolution (.1, .01, and .001) - and another pushbutton to assign the axis (x, y, or Z). So, it would default to the first value, and each time I push the button it iterates thru the list looping back to the first.
Is there an example somewhere or can someone help me figure out how to do this please/? Thanks.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7000
- Thank you received: 1172
21 Oct 2009 12:24 #1010
by BigJohnT
Replied by BigJohnT on topic Re:Help pls
I have not seen any examples like your asking about.
I would start by reading this chapter on HAL and develop a basic understanding of HAL commands.
www.linuxcnc.org/docview/html//hal_basic_hal.html
I wrote that section just for new users to help them get a jump start.
Next at the bottom of this page is all the man pages for the HAL realtime components. This is a good place to cruse the components.
www.linuxcnc.org/docview/html/
You have a good definition of your task, now you just need to figure out which component will do the task. You might still need the mux but need a bit different logic to turn on the inputs based on the current state.
push button => sel0 off & sel1 off = turn sel0 on
push button => sel0 on & sel1 off = turn sel0 off & turn sel1 on
etc.
John
I would start by reading this chapter on HAL and develop a basic understanding of HAL commands.
www.linuxcnc.org/docview/html//hal_basic_hal.html
I wrote that section just for new users to help them get a jump start.
Next at the bottom of this page is all the man pages for the HAL realtime components. This is a good place to cruse the components.
www.linuxcnc.org/docview/html/
You have a good definition of your task, now you just need to figure out which component will do the task. You might still need the mux but need a bit different logic to turn on the inputs based on the current state.
push button => sel0 off & sel1 off = turn sel0 on
push button => sel0 on & sel1 off = turn sel0 off & turn sel1 on
etc.
John
Please Log in or Create an account to join the conversation.
- drstein99
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
21 Oct 2009 14:53 - 21 Oct 2009 19:15 #1012
by drstein99
Replied by drstein99 on topic Re:Help pls
Well I got how the mux operates now, and the toggle command. Its really difficult for me to figure out this language, its very different from traditional programming with if/case & loop statements, w/ variables and math.
Last edit: 21 Oct 2009 19:15 by drstein99.
Please Log in or Create an account to join the conversation.
- drstein99
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
21 Oct 2009 21:23 #1013
by drstein99
Replied by drstein99 on topic Re:Help pls
Ok after many hours I finally got something that works. Its a little klunky but gets the job done:
selects between 4 values, on one momentary pushbutton.
net scale1 toggle.3.in <= pyvcp.jogResB1
net scale2 toggle.3.out => pyvcp.mux4Led1 toggle.4.in mux4.0.sel0
net scale3 toggle.4.out => pyvcp.mux4Led2 mux4.0.sel1
selects between 4 values, on one momentary pushbutton.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7000
- Thank you received: 1172
22 Oct 2009 12:32 #1018
by BigJohnT
Replied by BigJohnT on topic Re:Help pls
Nice work. What sequence does the mux have? It looks like it might be
sel0 off sel1 off
sel0 on sel1 on
sel0 off sel1 on
sel0 on sel1 off
But I have not tested it...
John
sel0 off sel1 off
sel0 on sel1 on
sel0 off sel1 on
sel0 on sel1 off
But I have not tested it...
John
Please Log in or Create an account to join the conversation.
- drstein99
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
22 Oct 2009 12:50 #1019
by drstein99
Replied by drstein99 on topic Re:Help pls
Yes. That is correct.
Now I have to do the same thing but instead with 3 values, and toggling the axis-enable pins.
Now I have to do the same thing but instead with 3 values, and toggling the axis-enable pins.
Please Log in or Create an account to join the conversation.
Time to create page: 0.126 seconds