05-26-2010 12:43 PM
Tanya,
Thanks for the code snippet! I've actually moved on with my application at this point (work deadlines and all that), and it is working fine using a dynamic reference to the subVI and just holding onto the reference via a functional global to keep the subVI in memory. I definitely wish I had built my subVI from the beginning with the model of running in parallel, and just showing or hiding the front panel as necessary similarly to how you described; I've stored your snippet away for reference for the next time. 🙂
Now I'm just trying to satisfy my intellectual curiousity (and broaden my LabVIEW knowledge); do you know how to use a static reference to run a subVI in parallel to the main VI, as opposed to the rest of us here? 😉
-Joe
05-27-2010 06:33 PM
Hi Joe,
The way you used the Static VI Reference in your second post is the correct way to use a VI reference if you want it to run the VI in parallel with your main VI. A Strictly Typed VI reference is for use with the Call by Reference Node, which calls VIs dynamically.There is a LabVIEW example that ships with the program that demonstrates how to use the Call by Refence Node. The example is called Dynamic Load Example and can be found in the Example Finder under Programmatically Controlling VIs»Dynamically Loading and Calling VIs»Dynamic Load Example.vi.
Kind regards,
05-28-2010 03:28 PM
06-02-2010 08:29 AM
Okay, just to have some closure to this thread, here's the final answer to my question. It turns out the solution is simpler than I had been making it; when I read "When the Static VI Reference function outputs a strictly typed VI reference, LabVIEW reserves the referenced VI as long as the top-level VI is running" in the LabVIEW help, I thought it meant that I had to mark the static VI reference as strictly typed if I wanted it to keep the VI in memory. That is not the case, and marking it as strictly typed was what was causing the problems with it already being reserved for running, etc.
When I removed the strictly-typed setting, everything suddenly worked like I wanted. Opening and closing the reference as I had been doing in earlier examples is also unnecessary with the static VI reference. The much simpler solution is shown here, and works just as I desired as described in my first post:
Thanks to everyone again for talking it out with me, even if for some reason the words weren't sinking in. 😉
-Joe
07-29-2011 02:44 AM
hi,
can u please tell me if it is possible to store a static vi reference in an array so that it can be used to run whenever it is called? If yes how?
I am new to labview, so any help would be appreciated. 🙂
Cheers
07-29-2011 07:32 AM
cmskorpion,
FYI, it is considered better forum manners to start a new thread if the current conversation has been over for more than a month or so, especially when asking a new question like this one.
To answer your question, most any type of data which you have on a wire can be put into an array by using the Build Array VI. I haven't done it personally, but I don't think static VI references would be any different.
Hope that helps,
-Joe
07-29-2011 07:50 AM
joe,
I will start a new thread. thanks for the advice, since i am new to this i am not aware of the general convenance. any inconvenience is regretted.
BTW also thanks for your suggestion.
-cmsKorpion