Go to Post What language does your programming mentor have the most experience with? That's the language you should use. - Rosiebotboss [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 02-04-2013, 01:23
wolfathart wolfathart is offline
Registered User
no team
 
Join Date: Apr 2013
Location: spokane
Posts: 2
wolfathart is an unknown quantity at this point
help with timed function

So I have searched for a few days for any examples of what I am trying to do but I cannot seem to find it.

Here is what I need to do:

press of button (x) turns on solenoid 1 while the button is pressed and turns off when the button is let go. However when the button is let go I need it to trigger solenoid 2 for say 3 seconds then turn it off.

I have gotten it to work where I press the button and it triggers solenoid 1 and when you let go it triggers solenoid 2 and turns off solenoid 1. The issue is that I dont want solenoid 2 left on all the time.

Can anyone show me an example of how to time this? any help will be greatly appreciated!
Reply With Quote
  #2   Spotlight this post!  
Unread 02-04-2013, 07:51
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: help with timed function

You have two options to add this to teleop.

One approach is to use a state machine directly in teleop code. You add a shift register or a global or other state data to remember that the code needs to do something in the future. Each time through, you check the state data to see if it is time to do the deed. When done, you clear it.

The other approach is that you put the code to close the solenoid somewhere else that is always running, like in Periodic Tasks. It mostly sleeps, but occasionally wakes up to see if you are telling it to do something. When you open the solenoid, you set a global telling it when to close the solenoid.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 02-04-2013, 18:36
wolfathart wolfathart is offline
Registered User
no team
 
Join Date: Apr 2013
Location: spokane
Posts: 2
wolfathart is an unknown quantity at this point
Re: help with timed function

Thank you for the responce however I am so new with labview I have no idea where to begin with those instructions. It would be much appreciated if there was anyway you could show me an example of this.

Thanks in advance.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-04-2013, 18:48
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: help with timed function

Quote:
Originally Posted by wolfathart View Post
Thank you for the responce however I am so new with labview I have no idea where to begin with those instructions. It would be much appreciated if there was anyway you could show me an example of this.

Thanks in advance.
I'm going to give you a couple links. The video you will want to launch to learn about one way to do "State Machines" is this first one.

The next link is to what I consider one of the best sites to use to learn LabView concepts for FRC. FRCMastery.com is an exceptional place to become competant at coding in LabView for FRC.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
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:04.

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