LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VI Reference.vi is blocking when a menu is opened?

Solved!
Go to solution

Hi,

 

I have recently realized that one of my sub-vi is blocking one of my while loops when any menu is opened: Right click menu, the menu bar, even drop-down controls menus.

And while investigating with the debug function on, it seems that it is Open VI Ref that is blocking.

 

It would be a bit complicated to share the VIs (dependencies) so here is a simple screenshot (sorry) with further explanation:

  1. The intent is to call asynchronously a timer function (simple loop with the "Elapsed Time.vi" setting the exit of the loop); This timer is attached below.
  2. The timer fires a User Event with a Queue and a message, The event structure that registers for this event sends the message on the queue and closes the Timer's reference; Specifically in this case, the timer basically calls itself periodically (For an "Update Data" kind of situation)

I thought it could have been a problem of threads: My interface (on which I open "the" menu; and which contains the VI that calls async the timer) is on the UI thread, and the subvi as well as the timer were on "Same as caller" execution thread. But I've changed that to UI, Other1 (sub-vi) and Other2 (Timer) just for the test and same results.

VinnyAstro_0-1695817178329.png

 

If more information are necessary, or if the actual VIs are necessary, please just ask, I will see what I can do.

 

Thanks for your help.

Vincent.

0 Kudos
Message 1 of 5
(737 Views)
Solution
Accepted by topic author VinnyAstro

Hi Vinny,

 

Here is a minimal example to reproduce your observation:

raphschru_0-1695818288624.png

 

This weird behavior is documented here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000001Dd6ISAS&l=en-US

 

According to the documentation, you can only avoid that by loading a generic vi ref and by name:

raphschru_1-1695818379804.png

 

I agree this is weird and a bit frustrating, but at least it is documented…

Maybe you could both report it as a bug and at the same time post it in the idea exchange 😂.

 

Regards,

Raphaël.

Message 2 of 5
(729 Views)

Damn that's weird.

 

Thanks for your help Raph, I'll try and make some changes then.

I'll see to open new tickets regarding this haha

0 Kudos
Message 3 of 5
(686 Views)

See this lovely blog post about the "root loop" for a pretty good explanation and some other details:

 

http://www.labviewcraftsmen.com/blog/the-root-loop

 

 

0 Kudos
Message 4 of 5
(632 Views)

Note that frameworks like Actor Framework and DQMH intentionally leak a single VI reference in order to avoid root loop issues when launching VIs dynamically. Here's a screenshot of the diagram of Launch Actor Core.vi from AF that describes the approach:

 

actorcore.png

0 Kudos
Message 5 of 5
(625 Views)