Go to Post I don't care if your robot could eat ours for breakfast - PayneTrain [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 23-07-2010, 14:04
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
Problem with Async VI Agent.vi staying alive

I'm having a problem when using the Wait function from the Interrupt palatte.

The problem seems related to the Async VI Agent.vi staying alive when the calling VI goes idle.

I've attached a small VI to demonstrate the problem.

The same type of problem has occurred when I have run projects based on some of the example code - and the only work around I've found is to use an Abort Invoke Node on Async VI Agent.vi when my top level VI closes. (But this required changing the library scope of Async VI Agent.vi from Private to Public, which is not an acceptable fix.)

Thanks,
David
Attached Files
File Type: vi WaitForInterrupt.vi (14.6 KB, 52 views)

Last edited by davidc10 : 23-07-2010 at 22:36.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-07-2010, 18:43
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: Problem with Async VI Agent.vi staying alive

Interesting. The purpose of the Asynch VI Agent is to own the FPGA Ref and any other appropriate shared I/O refs so that modifications to the framework that result in the first I/O being called from a dynamically loaded piece will not define the lifespan of the refnum.

The Asynch Agent explicitly inspects the state of the RobotMain VI and keeps the refnums alive until that VI goes idle. The some additional cleanup code was later added to the agent.

Can you clarify if you see the agent stay active when the RobotMain is idle? Can you open the agent and probe the VI name whose state it is polling? If this is not RobotMain, but winds up being another VI, that would be the thing to fix.

If you feel you need to send me stuff, send a PM and I'll give you contact info.
Greg McKaskle
Reply With Quote
  #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
  #4   Spotlight this post!  
Unread 25-07-2010, 22:26
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: Problem with Async VI Agent.vi staying alive

I left out the info about how it determines what is the top VI. As you noticed, since only one Start Comms is really allowed in a working app, that was selected as the element to use to ID the main hierarchy. As you noted, the FPGA ref can stay alive and be shared amongst many hierarchies, even ones that start and restart. We also noticed that interrupts act up on the third use and were not able to get to the bottom of it last year. We believe it is likely a deeper bug in the RIO driver.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 26-07-2010, 17:42
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

OK. Thanks again, David
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
[FTC]: Problem with Code or Problem with Bluetooth? VeedotJaydot FIRST Tech Challenge 3 27-01-2009 18:22
IT'S ALIVE!!!!!!!! WE HAVE CONQUERED ALL THE WORLD WITH THESE!!! sgsdragons Robot Showcase 23 13-03-2006 14:46
IT'S ALIVE!!!!!!! WE WILL CONQUER THE WORLD WITH THESE!!!!!! (Part 2) THE MOVIE sgsdragons Robot Showcase 20 16-02-2006 10:46
Free Agent Mentor. iceman_21 General Forum 2 25-09-2002 23:41
Staying with Seattle Ken Loyd General Forum 5 09-11-2001 23:52


All times are GMT -5. The time now is 22:01.

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