LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

main vi instances

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.

 

 

0 Kudos
Message 1 of 11
(3,897 Views)

Can you post your code?  Seems to me like you have some sort of cloning going on.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 11
(3,890 Views)

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. 

Download All
0 Kudos
Message 3 of 11
(3,859 Views)
I think this is just going to happen with Express VI's, and it is why I stopped using the Express time delay VI (I used to like it because it had the error in & out, but using it kept making my main VI instances duplicate per call to each Express VI - same problem you are having).
Richard






0 Kudos
Message 4 of 11
(3,844 Views)

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.

 

Stephanie A.
Americas Marketing Manager
National Instruments
Message 5 of 11
(3,825 Views)

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? 
0 Kudos
Message 6 of 11
(3,812 Views)

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. Smiley Very Happy

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 11
(3,793 Views)

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

0 Kudos
Message 8 of 11
(3,779 Views)

So you have inherited code with Express VIs.  OK, you are excused.  Smiley Wink

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.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 11
(3,767 Views)

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.

Stephanie A.
Americas Marketing Manager
National Instruments
0 Kudos
Message 10 of 11
(3,742 Views)