View Single Post
  #3   Spotlight this post!  
Unread 24-07-2010, 22:28
davidc10 davidc10 is offline
Registered User
FRC #0423
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Pennsylvania
Posts: 20
davidc10 will become famous soon enough
Re: Problem with Async VI Agent.vi staying alive

Greg,

I think I see it now. Async VI Agent.vi dies when the top caller of Start Communications.vi goes idle. (When you said it was tied to Robot Main.vi I looked a little deeper).

Now, if you look at the small example I attached yesterday, you'll see that I don't call Start Communication.vi; but the way Start Async Agent.vi is written, Start Communication.vi itself gets passed as the top caller - even though it isn't even in memory.

So if Async VI Agent.vi is waiting for the top caller to go idle - Start Communication.vi in this case - that's not going to happen. Since it was never loaded it's exec state is going to be "Bad", not "Idle", and Async VI Agent.vi doesn't terminate.

Often when we would re-work some of the FRC examples we would remove the Communications VIs since we weren't using them. That is why this problem has occurred before, but never in a full robot project.

Having Async VI Agent.vi bound in this way seems to impact the modularity a bit, but now that I'm aware of it I can work around it.

Going further though: most of the examples I have run without the Comm. VIs do not throw an error even when re-started many times, (with Async VI Agent continuing to run between re-starts). But if the code includes the WaitOnInterrupt.vi then there is an error - on the 3rd re-start in my example.

So I still don't know if there's a problem with WaitOnInterrupt.vi, but I will dig a little deeper.

Regards,
David
Reply With Quote