Michael Aivaliotis Posted June 24, 2003 Report Share Posted June 24, 2003 OK, can someone please explain how the static vi reference helps me in LV7? I mean you can drag a vi into it and it gives you a reference but is it really just for property nodes? The online help says: The Static VI Reference acts as a subVI and appears in the VI hierarchy of the top-level VI. You cannot use the Call By Reference node, Run VI method, or any other method to run a VI inside the Static VI Reference node. You also cannot use the Abort VI, Revert VI, Make Current Values Default, Export VI Strings, or Import VI Strings methods on the Static VI Reference node. To avoid recursion, you cannot have a reference to the top-level VI that the Static VI Reference is in. How boring... NI, why do you give us crippled capabilities? Quote Link to comment
Jim Kring Posted June 24, 2003 Report Share Posted June 24, 2003 OK, can someone please explain how the static vi reference helps me in LV7? I mean you can drag a vi into it and it gives you a reference but is it really just for property nodes? The online help says: The Static VI Reference acts as a subVI and appears in the VI hierarchy of the top-level VI. You cannot use the Call By Reference node, Run VI method, or any other method to run a VI inside the Static VI Reference node. You also cannot use the Abort VI, Revert VI, Make Current Values Default, Export VI Strings, or Import VI Strings methods on the Static VI Reference node. To avoid recursion, you cannot have a reference to the top-level VI that the Static VI Reference is in. How boring... NI, why do you give us crippled capabilities? I just ran into this problem a few days ago. Yes, it is amost completely useless. If you are not going to either Call or Run your VI by reference, then there is really no need for a static reference. I believe that you can use "Call by Reference" if the VI is reentrant - but then what is the point? The only reason to do a "Call by Ref" on a reentrant VI is so that you can have multiple dynamic instances of it. Here you can only get one reference to your static VI. I figured that I would hold back my initial disgust by looking for an example VI showing how NI sees us using such a tool, but there aren't any examples (that I could find) which use this new "feature". I give it 5 "Eye Rolling Emoticons" :roll: :roll: :roll: :roll: :roll: -Jim Quote Link to comment
Michael Aivaliotis Posted June 24, 2003 Author Report Share Posted June 24, 2003 ... I believe that you can use "Call by Reference" if the VI is reentrant - -Jim Yes, I just noticed this. Another curious thing... if you run the execution state property on the vi , right after the static reference, it shows the vi running. Is this because it is set for re-entrant run? This means you can run a vi that is running? I guess tis only works for reentrant vi's right? Well, i still don't understand the point of this static reference. Quote Link to comment
Jim Kring Posted June 28, 2003 Report Share Posted June 28, 2003 I have figured out one use for this: defining a callback VI that will be called by reference. Take a look at the ActiveX Event Callback examples. This design pattern actually looks pretty useful. I think that I will explore the possibilities of using callback VIs in my own reuse tools and components. Now, if only the LabVIEW documentation would have done us the favor of mentioning this... Quote Link to comment
Albert-Jan Brouwer Posted May 3, 2004 Report Share Posted May 3, 2004 After some initial puzzlement, I found static references to be rather useful. Since the VI pointed to by the static reference will be loaded when the containing VI is loaded, and included in a build when the containing VI is built, you can use it to get around the hassle of having to have a proper path for dynamically loaded VIs (at development time) or having to specifically include dynamically loaded VIs in the build script. Just wire the static reference to a property node, read the "VI name" propery, and use that to open an additional reference for running or calling. Quote Link to comment
Albert-Jan Brouwer Posted May 3, 2004 Report Share Posted May 3, 2004 Also, if the VI being referenced is reentrant, you can instantiate it. For running multiple instances, use the prepare for reentrant run option flag of Open VI reference. This does not work for templates though. Quote Link to comment
PJM_labview Posted May 3, 2004 Report Share Posted May 3, 2004 Also, if the VI being referenced is reentrant, you can instantiate it. For running multiple instances, use the prepare for reentrant run option flag of Open VI reference. This does not work for templates though. This is true, but it introduce a little annoying (for me at least) side effect when you do that. The reentrant VI appears to be linked to the VI where the static VI reference is. So if for example you are dynamically instanciating that reentrant VI and you are expecting it to show up in the VI Hierearchy (when is sucessfully instanciate), it will never happens because it is "linked" to the VI where the static VI reference is. It does make debugging, in this particular case, a little more difficult (like reentrant VI need to be made more difficult to debug ! ). PJM Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.