|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
Wire a constant 0 into the first block, connect Button 6 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant 0.5 to the output instead. Wire the output of the first block into the second block, connect Button 7 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant -0.5 to the output instead. Feed the output of the second block into the Set Motor vi. Done! This makes the "down" button take priority over the "up" button. Change the order of the case blocks if you want the "up" to override the "down" instead. For this kind of thing I would actually use select functions instead of case blocks, but that's not a big deal. |
|
#2
|
||||
|
||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Thanks guys. I think I have it fixed now. I will try it tonight at the shop and post my results.]\
-- Results-- Below I have included pictures of the section of code I'm wondering about. (I fixed the watch dog error thanks to whcirobotics and I got a rough version of motor sensitivity down.) This is the code that Alan suggested (well as I could understand from the text). Should it function properly? ![]() Last edited by Dustin Shadbolt : 13-10-2010 at 23:57. |
|
#3
|
||||
|
||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Another way to do this would be to do an Exclusive OR of the Button6 and Button7 values and feed the result into a case.
False would set the motor speed to zero. True would feed the value of Button7 into and If, the true leg = +1, false leg = -1. Output of IF would be multiplied by .5 and fed to motor speed. The Labview XOR looks like this: ![]() XOR returns FALSE if both values are either TRUE or both values are FALSE, otherwise it returns TRUE. |
|
#4
|
|||||
|
|||||
|
Re: Off season Questions **Need Help Asap/Code Check**
It looks like it will do what you want. You got it exactly as I described (except for the superfluous wiring through of the select input to an output of each case block -- that can be deleted without worry).
|
|
#5
|
||||
|
||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Thanks Alan. It makes total sense now after seeing it done. I can't believe I didn't think of doing it that way before.
|
|
#6
|
|||||
|
|||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
The TechnoKats 2009 robot had several motors that were used as either off, fixed speed forward, or fixed speed reverse. Our code got a lot less cluttered when we build a subVI to handle that function. Given a motor reference and a pair of button inputs, it did exactly what you were asking for. The forward and reverse speed values defaulted to +/- 1, but could be overridden by additional inputs. We also added limit switch inputs to disable travel in one or the other direction. That exact subVI wasn't reused in 2010 because it had never been published and was therefore not strictly legal for the new season according to the manual, but it was only a matter of minutes to recreate it from the basic concept. If we need it again next year, we know how to do it, and we'll probably put it out for public enjoyment this time. |
|
#7
|
||||
|
||||
|
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HELP- Need Globe Motors ASAP | Brandon Holley | General Forum | 0 | 03-11-2009 10:37 |
| Shipping confusion need help ASAP | Doug_I_854 | General Forum | 7 | 19-02-2008 10:58 |
| need help with ifi asap!! | 1075master | Technical Discussion | 13 | 06-01-2006 14:22 |
| Need Mplab help ASAP !! | L33T-meh- | Programming | 3 | 03-02-2004 21:39 |