Wednesday, March 05, 2008

VI Server References

In today's video, I answer the question "why doesn't the VI in the picture above work?"

Although a seemingly simple question, the answer involves some advanced VI Server topics, including the "lifetime" of VI references.

While putting together this video, I found a lot of other potential topics for future posts (e.g. What's a "This VI" reference? What's the difference between a subVI call, the Run VI method, and a Call by Reference node?) If you have other questions on this topic, please feel free to post a comment and I'll try to get you an answer!

- Christina

PS Here's the same video on YouTube in case the other link doesn't work for you.



Blogger Tomi M said...

Christina, a nice video blog post on an important and interesting issue.

I think thread spawning in LabVIEW has been somewhat neglected issue. It is because of this reason I released the Active VI Toolkit at my blog ExpressionFlow.

2:30 PM, March 06, 2008  
Blogger Yair said...

That definitely covers the topic well. When I first saw the question and the piece of code, I immediately thought "well, the answer is obvious, but the question might be wrong under some circumstances". Turns out you covered those circumstances. :-)

4:45 AM, March 07, 2008  
Anonymous Jim said...

Nice article/video, Christina. I've had to deal with VI (and queue, notifier, etc.) lifetime issues a thousand times and I'll probably do so a thousand more. These issues can be very tricky and it pays to understand what's going on behind the scenes. Thanks for the info.

11:08 AM, March 07, 2008  
Anonymous Jim said...

Christina. I've got a follow-up question that relates somewhat to your article: How come this code doesn't work? Thanks in advance for any help.

5:56 PM, March 11, 2008  
Blogger Christina said...

Tomi, Yair, and Jim, thanks for your comments!

Jim, I see that you've already submitted a bug report (thank you!) for the problem with the "All VIs in Memory" property. I hereby officially confirm that this behavior is a bug. The referenced VI is fully loaded into memory when the Open VI Reference completes execution, but the All VIs in Memory property is filtering it out of its list incorrectly. I looked up the CAR and the developers investigating the problem have found a workaround: "Place an empty sequence structure immediately after the open vi reference." I apologize for the inconvenience, and hope this helps!

8:44 PM, March 16, 2008  
Anonymous Jim said...

Christina: thanks for confirming this bug and for the work-around.

1:57 PM, March 17, 2008  
Blogger Albert said...

Hi Christina

Thanks for this video, can somebody of the documentation team make it an application note. I'm still of the old kind and like something written down.

4:19 PM, March 17, 2008  
Blogger Christina said...

I asked our documentation team to look into it. We don't actually have app notes anymore, but the content could be used in the Help or in a web document. Thanks!

3:45 PM, March 18, 2008  
Anonymous Anonymous said...

As a side note to this post, if you do close the reference of a VI that is still running, LV will temporarily lose window focus. This will also result in a large spike in CPU usage as the 'killed' VI is cleaned up. If the user was in the middle of typing data into a control when this happens, then they will be prevented from continuing until they click on the control again. There is a CAR for this issue.

5:12 PM, February 11, 2009  

Post a Comment

<< Home