07-19-2011 10:19 AM
I have a VI for opening a UDP connection, retrieving data, and then closing the connection:
Setting state to 1 opens a UDP connection.
Setting state to 2 retrieves a UDP package. Most boxes above is for data manipulation.
Setting state to 3 closes the UDP connection.
Now, calling this vi as a subvi works just fine:
But, calling the vi dynamically doesn't:
The second call inside the while loop raises an error. Apparently, referenses are not valid from one call to the next when calling a dynamically loaded vi. What I need to know is, is there a convenient way around this?
Solved! Go to Solution.
07-19-2011 10:38 AM
Hello,
Calling dynamically a VI inside a while loop may be pretty bad in terms of performance and I'm not sure that's a good idea.
But if you really want to do this, using "Call by Reference Node" function should be more appropriate in your case (you will find some example easily).
Best,
J.
07-19-2011 12:15 PM
Worked perfectly, thank you.
> Calling dynamically a VI inside a while loop may be pretty bad in terms of performance and I'm not sure that's a good idea.
Making the dynamic vi reentrant makes performance decent.