05-17-2010 04:00 PM
I have a single main executable vi which is run once (and if I set breakpoints in the initialization steps, the program only stops there once as expected). However, if I run another vi and look at Application:All VIs in memory, this lists the main vi with a state of "Run top level" and 6 other instances (main.vi:Instance:0 to main.vi:Instance:5) with a state of "Running".
This also occurs on some (but by no means all) of the other sub-vis (up to Instance:12 in one case) even though none of them are re-entrant.
It's not actually hurting anything (as far as I know) but I'm curious about what's happening.
05-17-2010 04:13 PM
Can you post your code? Seems to me like you have some sort of cloning going on.
05-18-2010 10:31 AM
Playing with it some more, an "instance" seems to come from each express vi (even if it is disabled).
It would be nice if the name of the express vi was listed so you could distinguish between them but at least I can tell the express vis from the main one.
05-18-2010 10:59 AM
05-18-2010 11:49 AM
This is actually expected behavior in LabVIEW. If a top-level VI contains some Express VIs then an instance is created of the top-level VI for each Express VI. The number of the instance is created based on the order that the Express VIs are dropped on the diagram.
05-18-2010 02:35 PM
StephanieO wrote:This is actually expected behavior in LabVIEW. If a top-level VI contains some Express VIs then an instance is created of the top-level VI for each Express VI.
What effect does this have on performance?
05-18-2010 03:42 PM
I think the general consensus here is to NOT use Express VIs. Just code it out in full. You will have much better control over your code and you can make any modifications to tweak your code. With Express VI's, you are locked in to that particular code.
Beginners usually use Express VIs because they are easy and provide instant code. Sooner or later, they all migrate to writing their own code.
If it sounds like I'm knocking Express VIs, yes I am.
05-18-2010 03:59 PM
tbob wrote:I think the general consensus here is to NOT use Express VIs. Just code it out in full. You will have much better control over your code and you can make any modifications to tweak your code. With Express VI's, you are locked in to that particular code.
Beginners usually use Express VIs because they are easy and provide instant code. Sooner or later, they all migrate to writing their own code.
If it sounds like I'm knocking Express VIs, yes I am.
The question is not "is it a good idea to use the Express VIs?" but "given I currently have code with Express VIs already in it, what is the urgency to get them changed?"
If I can point to a large performance hit, memory issue etc, then I have a justification to go through & change them all now. If not, then they'll probably have to remain until I come to change that part of the code for some other reason (bug, new feature etc).
05-18-2010 04:28 PM
So you have inherited code with Express VIs. OK, you are excused.
I'm not sure about memory or performance hits with Express VIs. I would think there is some overhead due to the nature of Express IVs, but I'm not sure how much of a performance hit it causes. Maybe an NI guy could answer that one.
05-19-2010 11:24 AM
Here is an excellent discussion forum that discusses the performance differences between using Express VIs versus the lower level VIs. I hope you find this information helpful.