Jump to content

Recommended Posts

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?

Link to comment
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

Link to comment
...  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.

Link to comment

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...

Link to comment
  • 10 months later...

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.

Link to comment
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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.