Showing results for 
Search instead for 
Did you mean: 

Static VI reference to Dynamic VI returning invalid reference on first call


when i first load a project file containing an object orientated "dynamic VI" and try to return a reference to it via the static VI reference, it returns an invalid ref num. Everytime I run it afterwards, w/o closing the project it will return the correct refnum.

Enclosed is a sample project that clearly demonstrates the error.


1. Open the project and load VI called reference.

2. Attach probes to the two reference nodes.

3. Notice how the Probe attached to the VI that returns a static reference gives an invalid ref num, but the probe attached to the VI that references itself returns the correct value.

4. Run the VI again. Now both return the same value.

5. Close the project completely to get back to the initial error.

It looks like labview isn't associating the VI refnum correctly with the static VI reference until after it has been executed once. Calling the referenced VI in a sequence before calling the static reference doesn't fix the problem.

Greg sonnenfeld
Message 1 of 4
Behaviour confirmed! Smiley Happy
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 4

Same here.

I've gone ahead and reported this bug for you to R & D.  (Corrective Action Request - #98441)

Let us know if you find a suitable work-around other than running the VI twice, and thanks for your feedback!

Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
Thanks again for pointing this out. Feedback of this kind is invaluable and we appreciate it.

The easiest workaround to this problem is to make the static VI reference strictly typed.

You presumably don't need this extra behavior, but it shouldn't hurt to add it as a workaround. To make the Static VI Reference strictly-typed, right click it and select that option.

Hope this helps!
Jarrod S.
National Instruments
Message 4 of 4