If i use a sub-vi 3 times simultaneously in my main program....

If i use a sub-vi 3 times simultaneously in my main program. Do i need
to create that many of those sub-vi's and the VI's inside the that

In my main VI, I am calling a sub vi to do math on the data. I am
doing this process simulataneously on the data collected from three
channels. I created three sub vi's with same functionality but with
different names so that they can be called separetly at the same time.
My question is do I also need to create that many copies of the
sub-vi's which I am calling inside the Sub-VI used to do math on the
data collected from channels?
x9561 (148461)
6/14/2004 7:17:00 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

10 Replies

Similar Articles

[PageSpeed] 51

Simple answer is yes, you would need copies of the subvis also.
LabVIEW can only have one copy of a certain named VI in memory at a


You make the VI Reentrant. Setting a VI to reentrant causes LabVIEW to
open each instance of the VI in it's own data space, so it acts the
same as having differently named VI that are the same. You set this by
going into the VI properties, select the Execution catagory and
checking the "Reentrant Execution" checkbox. You wold also need to do
this on any subvis you want to run as separate copies. The propertiy
is not inherited.
x9561 (148461)
6/14/2004 7:54:17 PM
if i make my sub vi's as reentrant, do I lose any process speed, in
other words are there any limitation for using the reentrant
execution? and thanks for your reply.
x9561 (148461)
6/15/2004 11:23:13 AM
As far as I know, making a subvi reentrant would have no performance
difference over having multiple VIs with different names. Maybe an app
eng could verify this.

Each time a reentrant VI is called from a new location in the code, it
creates a separate area for it in LabVIEWs dataspace, the same as
calling a new subvi would do.

x9561 (148461)
6/15/2004 12:26:12 PM

You may pick some up.

What you will loose is debugging.

The main "gotcha" is the seperate memory space issue mentioned

This means that if your sub-VI's use local storage (like shift
register that store results from the last call for use in the next)
are distict for each occurence of the sub-VI in a diagram.

Also, if your sub-VI use larege amounts of memory the use will be
duplicated between each instance.

x9561 (148461)
6/15/2004 12:28:35 PM
My "NO" was to Mudda Q.

I am the same page as Ed.

x9561 (148461)
6/15/2004 12:29:51 PM
If the subvi does not contain data that are dependent on a previous
run , such as local variable or shift register data, then there is no
need to make the vi reentrant.
x9561 (148461)
6/15/2004 12:35:48 PM
If the sub-VI is CPU intensive,
you do not want one call of the sub-VI to delay another call to the

Then re-entrancy is very useful.

x9561 (148461)
6/15/2004 12:39:24 PM
In principle, Yes,
However, how much true that is depends on how LabView (R/D)developers
are implementing it, and things have been changing between LabView
versions, to different degrees, all the time.
x9561 (148461)
6/15/2004 1:22:16 PM
Yes sir!

From what I have read about LV 7.X and hyperthreading, two of these
re-entrant sub-VI's can be executing simultaneously without having to
resort to dual-proccessors.

x9561 (148461)
6/15/2004 1:26:34 PM
Thanks to all of you for your comments,

x9561 (148461)
6/15/2004 2:24:42 PM