05-31-2013 09:44 AM
@crossrulz wrote:
@camerond wrote:
Here's an easy way to do it, using a WHILE loop, T/F Case structures and local variables.
Cameron
Ok, just looked at your example. Event structure is so much easier. And to make it even easier on you, use latching buttons. Then you don't need the locals to reset the buttons. When the button's terminal is read, the latch will reset. And I don't see where this is applicable to the OP's question about the subVI's panel not closing
Yeah, I should have used latching controls and left off the LV's. But where this is applicable to the OP's question is that the way he did it, he was right, the subVI's panel did not close on the second reentry. I had to shut down LV to regain control.
In my (admittedly pitiful) defense, someone had just taken the last cup of coffee and I wrote that reply before the next pot had finished brewing for my first cup. ![]()
Cameron
05-31-2013 09:45 AM
@camerond wrote:
Wait, wait 250 msec now. I didn't peg the CPU core, I had a quarter-second wait in there between loops. At least I did that right, AFAIK. Didn't I?
You may have realized that I'm not a real computer jock by now. The last 18 years or so I've been doing most of my programming in Perl, where TIMTOWTDI is a way of life.
Cameron
Yes. I didn't look at your example until after I made that comment. My bad.
I am a full believer in the KISS (Keep It Simple Stupid). And polling buttons is complicated when a simple event structure will do it. This is especially true when you get a decently complicated GUI going.
05-31-2013 10:38 AM - edited 05-31-2013 10:48 AM
have you tried dynamic loading? loads into memory when called and unloads reference when sub vi exits
**note: make sure sub vi path constant is pointing towards the downloaded folder**
05-31-2013 05:33 PM
Thanks for answers. I decided for the following solution...
06-01-2013 05:20 AM
I tried to apply your solution to my work. I prepared simple code where I want to demanstrate the usage. It works fine in the firs case of subVI1, however in case of subVI2 it is not possible to turn it off. There are two loops synchronized by occurence. Please check it ....
06-01-2013 08:40 AM - edited 06-01-2013 08:47 AM
@charlie87 wrote:
I tried to apply your solution to my work. I prepared simple code where I want to demanstrate the usage. It works fine in the firs case of subVI1, however in case of subVI2 it is not possible to turn it off. There are two loops synchronized by occurrences. Please check it ....
note: the concept was about memory loading and unloading of sub vi's and their usage
08-19-2013 08:50 AM
I'm dealing with the exact same issue right now. However I use LV 2010 so I am unable to open some of the solutions posted on here. Can more of you post your suggestions as a bmp (as Apok has done) so I can see your answers? Thanks!
08-20-2013 02:24 AM
To Open the subVI dynamicaly you can use the idea of Apok posted above. The path to the subVI is used to open it by using Invoke Node (Application Control Palette). You need to set the VI properties to Open the Front Panel when loaded. If you want to open a static subVI (always the only one) you can just put the subVI into the event case structure instead of the invoke node and set the VI properties to open FP when loaded again.
To close the subVI it depends if you want to close in the caller (main VI) or the subVI which was open... try to use the VI Server and Invoke Node options such as Abort and Close/Open FP to achieve your solution