Go to Post I'm looking forward to seeing it in action! That is one sweet looking gun. The look on his face has me a tad worried though.... - Zholl [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2011, 23:47
Team 3883 Lead's Avatar
Team 3883 Lead Team 3883 Lead is offline
James - Team 3883 Lead
FRC #3883 (Data Bits)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Cottage Grove, MN
Posts: 4
Team 3883 Lead is an unknown quantity at this point
Trying to program joystick buttons

Hi this is Rookie Team 3883.

I am trying to program a double solenoid to either a) two different buttons, for extend / retract or B) program it so if I push the button, say to extend an actuator, an accidental press of the button in rapid sucesion wont cause it to retract... i.e. ... trying to prevent a false double triggering of the solenoid.

Our lift arm folds like a back hoe..... don't want to refold it, and also looking at control of the manipulator claw actuator.

We'll learn LabView, but it's kickin our buts right now.

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2011, 00:01
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Trying to program joystick buttons

I don't know how good at programming you all are, but here's some basic tips to consider that don't require any knowledge of labview.

If you want to do something with your code, draw out what you want the program to do (make requirements). Be specific. For example, in your A case, what do you want it to do if both buttons are pressed? If neither is pressed? If the arm is already out, what does the out button do? That example has 8 different states, and you should write down what you want the program to do in each one. Actually, you have 8 control states but you also need to program when to stop the arm. Think about your sensors, and what you want them to do when the arm is going either in or out or is already in or out.

For your B problem, I don't see why you need that code at all. If the extend button doesn't do anything when the arm is already out, why should it matter if the arm is already out? Anyway, unless you're talking about switch debouncing (the "bouncing" that occurs when a physical button is pressed that makes contact on and off really fast before the button is all the way on), you should probably just train your drivers to not press the button if the arm is already out. If you don't want to do that, just go ahead and make very specific requirements of what you want your code to do.

When you're done with that, you need to do the actual programming. Since you have all those cases, I'd say start with a case structure or two. An easy way to make one case structure out of a bunch of boolean values is to use the build array function. Expand it, put all your booleans into it, and then use the boolean array to number function to make a number that you feed into the case structure. That lets you have different numbers for all the way the buttons and arm-movements could react (ie in case 7, the first three booleans are pressed and none of the others - binary computation.)

Another good-programming technique is to only have one function where you call the actuator. This means all of the case strctures should output a TRUE or a FALSE depending on which solonoid should be pressed, and then have the solonoid set wired up to that.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2011, 00:26
Team 3883 Lead's Avatar
Team 3883 Lead Team 3883 Lead is offline
James - Team 3883 Lead
FRC #3883 (Data Bits)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Cottage Grove, MN
Posts: 4
Team 3883 Lead is an unknown quantity at this point
Re: Trying to program joystick buttons

Thanks for the info. We are new to Labview. We became a team on Jan 15. Most of it doesn't make sense yet, but we are learning each day.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2011, 00:37
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: Trying to program joystick buttons

I suggest you go to www.frcmastery.com it is a great resource for learning LabVIEW
__________________
Expect the best, Prepare for the worst
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2011, 10:37
Durham86 Durham86 is offline
Registered User
FRC #2883
 
Join Date: Dec 2009
Location: warroad,MN
Posts: 8
Durham86 is an unknown quantity at this point
Re: Trying to program joystick buttons

As of right now we have our buttons set up to momentary. What we want it to do is latch so that when you hit one button the cylinder will shoot out and when we hit the same button it will retract. So basically what I am asking is how do you set that up programming wise.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2011, 11:18
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,280
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Trying to program joystick buttons

Quote:
Originally Posted by Durham86 View Post
As of right now we have our buttons set up to momentary. What we want it to do is latch so that when you hit one button the cylinder will shoot out and when we hit the same button it will retract. So basically what I am asking is how do you set that up programming wise.
NI provided an example of this. Check out :

Program Files >> National Instruments >> LabVIEW 8.6 >> examples >> FRC >> Driver Station Inputs >> Joystick Button Latching >> Joystick Button Latching.vi
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2011, 11:21
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Trying to program joystick buttons

Quote:
Originally Posted by Durham86 View Post
What we want it to do is latch so that when you hit one button the cylinder will shoot out and when we hit the same button it will retract.
Please reconsider that decision. "Toggle" functions are not hard to do (in LabVIEW, C++, or any language), but they are rarely good driver interface design.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi