LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading dynamically a sub VI kills event handling

Solved!
Go to solution

Dear All,

 

I have  a mainVI, which loads several subVIs in a random (user defined) order dynamically. Currently my subVIs run a for loop 1..10 for testing. I have the conditional terminal enabled, connected a stop button to that, to be able to stop the running of the subVI. If I run the subVI standalone, of course it works perfectly. 

 

However, if I load and run it dynamically from the mainVI, in sync mode (Call By Reference, and also load the subVI's front panel into a panel), event handling is killed in both the mainVI and the subVI: I can't press any button neither in the mainVI's front panel, nor the stop button of the subVI loaded into the panel. My goal is to show the process implemented in the subVI for the user, but also to be able to break the execution of the subVI, if necessary. The reason why I would like to separate the functionality into subVIs is that there are many different tests, implemented and maintained by several developers, so e.g. one big functionalglobal wouldn't fit.

 

Async mode doesn't fit my needs, because the user should see continueously what happens in the subVI (it performs some measurings / tests). So except this event blocking, this would be a perfect solution. 

 

Could anyone suggest a good solution / fix here? Thanks in advance!

 

I use LV2015

0 Kudos
Message 1 of 7
(2,093 Views)

Can you provide a simple example (perhaps your real main VI, two dummy SubVIs with some simple functionality and a project file in a zip file)?

 

That might help speed up our helping you 


GCentral
0 Kudos
Message 2 of 7
(2,083 Views)
Solution
Accepted by topic author vilagvevo

Do you have the UI events set to "Lock Front Panel until Event is handled"?

 

That would do it.

0 Kudos
Message 3 of 7
(2,053 Views)

Dear cbutcher,

 

thanks for the quick reply! I have prepared a simple example, and it works. Strange is that if I run the subVI from my working testproject in the real one, it doesn't work. It seems that I have some problem in my real mainVI, still after I have replaced the affected loop content. I will do more tests. Thank you!

0 Kudos
Message 4 of 7
(2,046 Views)

I can say only Thank you, Sir! 

 

0 Kudos
Message 5 of 7
(2,034 Views)

No Problem.

 

Have run into that one on many occasions. It always seems like it's caused by something else, so I thought it might be worth a stab in the dark.

0 Kudos
Message 6 of 7
(2,031 Views)

@Intaris wrote:

No Problem.

 

Have run into that one on many occasions. It always seems like it's caused by something else, so I thought it might be worth a stab in the dark.


I've never run into an issue with an unresponsive UI where the actual solution was to unlock the front panel.  It seemed that I always found a way without resorting to that.  I consider unlocking the front panel to be a "workaround" so if you could give me an example or two where there are no other alternatives to unlocking it, I could learn something.

 

I'll be the first to admit that maybe my programming isn't complex enough to ever run into this issue.

 

Thanks!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 7
(2,001 Views)