Go to Post Practice. Don't leave home without it. - JesseK [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 21-02-2010, 15:20
FRCMikeH FRCMikeH is offline
Registered User
None #0612
 
Join Date: Feb 2010
Location: Fairfax
Posts: 2
FRCMikeH is an unknown quantity at this point
"Wait" pauses all robot code?

Hi,

We are encountering an issue where using wait pauses execution of the entire robot.

Our robot uses a piston to move the kick mecahnism. We would like to be able to retract our kick mechanism while we are driving. Our lab view code for retracting the kick mechanism is in a seperate VI and uses a 'wait' to wait for the piston to become fully retracted. From the lab view documentation, we thought the wait would allow other parallel sub VIs to execute (like driving VI)

However, when we encounter the wait the entire program waits, so we can't drive or do anything else while the kick mechanism is retracting. The drive and other VIs do not have any inputs from the retract piston VI, so there shouldn't be any dependancies.

Is there a way to wait without pausing execution of the entire robot?

Any help is much appreciated, thanks!

Mike
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2010, 15:27
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,748
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: "Wait" pauses all robot code?

Without looking at your code, I'm having to guess a bit, but it sounds like your tele is calling a subVI that takes its time to execute. On a LV diagram, a simple subVI call is synchronous, meaning that they are synchronized, and the caller will not complete until the subVI returns.

To have code run in parallel, move it into a parallel loop. Then come up with a way for the tele code to tell the parallel loop what to do. You could use fancier things, but a simple approach is to put the parallel loop into Periodic tasks, and use a global or two to let tele start things and let Periodic finish them.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 21-02-2010, 16:18
robotic321's Avatar
robotic321 robotic321 is offline
Registered User
FRC #1793
 
Join Date: Jan 2010
Location: Norfolk, VA
Posts: 24
robotic321 is an unknown quantity at this point
Re: "Wait" pauses all robot code?

Search for my forum called "solenoid timeing" or like that. someone posted with some helpful tips.
__________________
=-=-=-=-=-=-=-=-=-=-=-=-=-=


1793 FTW
=-=-=-=-=-=-=-=-=-=-=-=-=-=
Reply With Quote
  #4   Spotlight this post!  
Unread 21-02-2010, 19:45
FRCMikeH FRCMikeH is offline
Registered User
None #0612
 
Join Date: Feb 2010
Location: Fairfax
Posts: 2
FRCMikeH is an unknown quantity at this point
Re: "Wait" pauses all robot code?

Problem solved.

We implemented a state machine that checked the tick count vi to check the elapsed time. If the time expired we went to the next state otherwise we stayed in the current state.

Greg, we tried your advice, but it didn't work. In theory it should have so it could have been our implementation, but I think it was good. We did the following:
Put our slow retract piston in a while loop at the top level of robot main. Then we enabled the code using a global variable from the teleop vi. Unfortunately we saw the same problems.

Anyway, problem solved. Thanks for your help!

As a side note, we built a subvi wrapper for the 'wait' vi to feed the watchdog time because our wait statements were causing watchdog timer errors. Have others had to do this?
Reply With Quote
  #5   Spotlight this post!  
Unread 21-02-2010, 19:52
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,560
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: "Wait" pauses all robot code?

Quote:
Originally Posted by FRCMikeH View Post
As a side note, we built a subvi wrapper for the 'wait' vi to feed the watchdog time because our wait statements were causing watchdog timer errors. Have others had to do this?
There is a delay and feed VI in the watchdog pallet that does this.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-02-2010, 21:44
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,748
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: "Wait" pauses all robot code?

There are many ways of doing this. My guess is that putting the code into Robot Main had it run in parallel with Begin, and therefore not get valid references. If you want to use this pattern for something else, go ahead and place the code into the subVI Periodic Tasks. Unless you are going to guarantee that Begin completes before your code requests the I/O references, it is best not to put code into Main.

Greg McKaskle

Last edited by Greg McKaskle : 21-02-2010 at 21:45. Reason: grammar
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
Weird issue "No Robot Code" chdmwu C/C++ 4 12-02-2011 14:22
"No Robot Code" problem Deep-Blue C/C++ 4 14-02-2010 17:57
"No Robot Code" error? plus other issues... 3195mentor NI LabVIEW 3 13-02-2010 08:20
G-FORCE's robot, named "philbot" a.k.a "armagedon in a polycarbonate box" Bryan_2818 Robot Showcase 0 12-04-2009 20:54
Code error on RC after downloading "bells and whistles" version of Kevins camera code DanDon Programming 6 10-01-2006 18:07


All times are GMT -5. The time now is 04:42.

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