Go to Post I fear not the drive team who has practiced 10,000 defenses once, but I fear the drive team who has practiced one defense 10,000 times. -Bruce Lee - bEdhEd [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 Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 12-03-2010, 22:54
tranbaohan tranbaohan is offline
Registered User
FRC #2250
 
Join Date: Mar 2010
Location: denver, co
Posts: 4
tranbaohan is an unknown quantity at this point
Need help with Elapsed Time VI

Hi everybody, I'm a programmer for team #2250 (I apologize for my bad English). I got a problem with the Elapsed time VI (i think). I'm trying to set a loop that run in a certain amount of time (4 sec). I put 2 elapsed time VIs in 2 while loop cases. I set the time target is 4, the auto reset setting is true, the start time is 0 for each of them. The 2 loops is inside a sequence flat case (separately). When I try to run it, the robot does exactly what I want (a motor run forward 4 sec, then run backward for another 4 sec). However, when I try to do it the second time (with the same program), the timing goes crazy. The motor run forward for about 2, or 3 sec and then stop when it supposes to run backward. I reset the robot, deploy the same code again, and the first time I press the button, it goes very well (forward and backward), the second time, it is bad. I believe there are some mistakes in settings of the elapsed time VI. I think if I add some codes to reset it completely before run the loop (whenever I press the button) maybe helpful but I don't know how to fix it. Any ideas will be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 13-03-2010, 16:33
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,112
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: Need help with Elapsed Time VI

It's hard to follow your description well enough to give you good advice. It would help if we could see your code, or at least a picture of it.

Also, where is this code placed? There might be a better or easier way to do what you want.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-03-2010, 17:15
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Need help with Elapsed Time VI

I think I know what you mean. If you set it to auto reset than when you press the button, the time in between the reset and pressing the button has already occurred and say 1 second has been in between the reset and the time the button was pressed, it will only seem like 3 seconds when really it has been 4 seconds. If you reset the timer when you press the button it should do what you want it to. You will also have to reset the second timer when the first timer has elapsed. But be careful because if you hold the button down then it will continue to reset itself and time will not elapse until 4 seconds after you release the button. Is this what you needed?
Reply With Quote
  #4   Spotlight this post!  
Unread 13-03-2010, 18:27
tranbaohan tranbaohan is offline
Registered User
FRC #2250
 
Join Date: Mar 2010
Location: denver, co
Posts: 4
tranbaohan is an unknown quantity at this point
Re: Need help with Elapsed Time VI

sorry for the disconvenient , I got the pic for what inside the button 1- true case ( it is too big, i can't post the whole code up). Basically, on the left side, the first 2 wires are the solenoid references, the 3rd is the watchdog reference, the last one is for a motor. What supposed to happen is the solenoid goes out, the motor run forward 4 sec, the solenoid goes back in then the motor run backward 4 sec. It always work perfectly the first time I press button 1, but the second time , or third, it doesn't: The solenoid goes out, motor run for 1 or 2 sec then the solenoid goes in and then motor stop, not running at all. Thanks for replying me.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-03-2010, 00:13
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,112
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: Need help with Elapsed Time VI

I'm not entirely sure where and when you're trying to do this. I think you can make it do what you want by removing the while loops, deleting the Elapsed Time, replacing the watchdog feed inside the loops with watchdog "feed and delay", and using the error inputs and outputs of the various vi's to control the order of events. If you have last year's default LabVIEW code to look at, its Autonomous Independent shows how to do it.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-03-2010, 01:08
tranbaohan tranbaohan is offline
Registered User
FRC #2250
 
Join Date: Mar 2010
Location: denver, co
Posts: 4
tranbaohan is an unknown quantity at this point
Re: Need help with Elapsed Time VI

I solved it this afternoon. I was over think the problem. You are right Alan, I don't need the loop and the elapse time vi, but I have to leave the watchdog feed tinggy( or else it will say watchdog not fed on the driver station). I just put a delay vi, set it to 4 sec and the set motor speed. Everything is working now. Thanks for helping me, both of you.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-03-2010, 01:15
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Need help with Elapsed Time VI

Quote:
Originally Posted by tranbaohan View Post
I solved it this afternoon. I was over think the problem. You are right Alan, I don't need the loop and the elapse time vi, but I have to leave the watchdog feed tinggy( or else it will say watchdog not fed on the driver station). I just put a delay vi, set it to 4 sec and the set motor speed. Everything is working now. Thanks for helping me, both of you.
His point is that if you replace the Watchdog Feed with the Watchdog Delay and Feed, you don't need the while loop or a separate Delay.

The Watchdog Delay and Feed will feed the Watchdog periodically as it delays.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #8   Spotlight this post!  
Unread 14-03-2010, 01:42
tranbaohan tranbaohan is offline
Registered User
FRC #2250
 
Join Date: Mar 2010
Location: denver, co
Posts: 4
tranbaohan is an unknown quantity at this point
Re: Need help with Elapsed Time VI

No, I'm talking about the time delay VI, not the watchdog delay vi.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-03-2010, 00:35
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Need help with Elapsed Time VI

Quote:
Originally Posted by tranbaohan View Post
No, I'm talking about the time delay VI, not the watchdog delay vi.
Right... and what he is saying it to use the delay and feed VI instead of a delay and a feed separately.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Teleop Elapsed Time available in Dashboard? Ziaholic NI LabVIEW 0 21-02-2010 23:13
Finding the Elapsed Time in a Match davidalln C/C++ 1 08-02-2010 23:58
FIRST TIME USING C++, Need help! DarKCroNo Programming 8 07-02-2010 00:53
Tracking Elapsed Time 7-11number1 Programming 4 13-01-2008 16:16
need help with time zone! Ken Leung General Forum 6 25-06-2001 12:44


All times are GMT -5. The time now is 03:47.

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