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

  • Permalink
  • submit to reddit
  • Email
  • Follow

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?
Reply x9561 (148620) 6/14/2004 7:17:00 PM

See related articles to this posting

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.
Reply x9561 (148620) 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.
Reply x9561 (148620) 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.

Reply x9561 (148620) 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.

Reply x9561 (148620) 6/15/2004 12:28:35 PM

My "NO" was to Mudda Q.

I am the same page as Ed.

Reply x9561 (148620) 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.
Reply x9561 (148620) 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.

Reply x9561 (148620) 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.
Reply x9561 (148620) 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.

Reply x9561 (148620) 6/15/2004 1:26:34 PM

Thanks to all of you for your comments,

Reply x9561 (148620) 6/15/2004 2:24:42 PM
comp.lang.labview 35389 articles. 14 followers. Post

10 Replies

Similar Articles

[PageSpeed] 52

  • Permalink
  • submit to reddit
  • Email
  • Follow


Similar Artilces:

Link indicator readings on a sub vi to a front panel on a main program in real time
Hello I am trying to link indicators on a sub vi to indicators on a main program in real time. The sub vi is set-up to perform data acquisition and I want to be able to show that data acquisition in real time on the main program front panel, how do I accomplish this? Hi Josh.G, you can use the references from your main vi. Create an array of these references and connect it to your subvi. There you can use a prperty node to write the new value. Another way is to use queues or notifier. Write the data into one of them and read it in your main vi, if you have time for it. Hope it helps...

Control a while loop in the sub vi using a button in the main vi?
Dear all,     I want to be able to control ( turn on or off) a while loop in the sub vi from a button control in the main vi. How can I use the Control Reference to achieve it?   Thank you in advance.  Like this look at attached vi's Run the main vi   main_boolean.vi: http://forums.ni.com/attachments/ni/170/242103/1/main_boolean.vi sub_boolean.vi: http://forums.ni.com/attachments/ni/170/242103/2/sub_boolean.vi ...

Using a sub-vi to write the strings of a ring inside a cluster on the main VI.
I have an array of ring controls in a cluster on my main VI. Now I want to use a Sub-VI to fill in the strings of the text ring from an array. I tried refnums and property nodes and "to more specific class". I can access the ring array but whatever string I write in there doesn't show up. Can anybody please give me an example of how to do this? I am using LabVIEW 6.02 Thanks ...

Can I execute a sub VI mutilple times at the same time using Reference Nodes
I want to call a subVI multiple times depending on the test. I can create multiple References but once I execute one Reference, but it I get an error 1000 when i try to run the second Reference. ...

How to pass parameters between main and sub vi during parallel execution using the VI server technique?
Hello All, I am working with the following example (from previous postings on this board) that demonstrates how to run a sub vi in parallel with the main vi.  I'd like to pass parameters between the main and sub such as the control (delay) and indicator (value) parameters of my subvi example.  Does any one know how to do this?  Parallel execution is important for me, I cannot just paste the subvi icon into my main diagram (two nested while loops...) Many thanks, Luis Message Edited by cascao on 08-16-2005 08:42 PMMessage Edited by cascao on 08-16-2005 08:4...

sub vi with cluster does not pass variables to main vi and causes whole program to lock
Hi all,   I am trying to use a cluster inside of a sub vi as a "control panel" to change control values of pass on the main vi. The basic idea is that I want to call the sub vi, change the values in the cluster on the sub vi, pass those values to the main vi, unbundle them by name on the main vi and use those values in main vi.   Right now, when ever I try to click on the "Go to the Controls" button on the main vi, it calls the sub vi, but it runs extremely slowly or locks up the whole system. Also when I hit the stop bu...

Programming VI as a sub VI in parent VI
Hi There,   Could anybody please guide me about: How I can include a VI as a subVI in parent VI, i.e. If I have a VI with all controls and indicators and I just want this VI to be included in parent VI as a icon.   Also, if I am able to do so, how the sub VI will be recalled from parent VI and how the connections are possible?   Please advise me.   Thanks for your time. Amit. Hi Amit, the easiest way is to open both vi�s and insert the sub vi with drag and drop. Move the mouse over the subvi icon and press your left mouse button. Now you can insert it into...

running one sub vi in background while the main vi uses it's generated data, producer/consumer?
Hi, &nbsp; I would like to have a subrutine running at the same time as the rest of the main vi. The subrutine will be constantly producing data, and the main rutine should do different tasks depending on which data has generated the subrutine in that instant. I have read about producer/consumer design <a href="http://zone.ni.com/devzone/cda/tut/p/id/3023" target="_blank">http://zone.ni.com/devzone/cda/tut/p/id/3023</a>&nbsp;but I don't know how to implement this with LV 5.1&nbsp;&nbsp; Somebody know if it's possible, or there is somethin...

Is there anyway to save the configuration used to analyze sub-VI's so I do not have to manually uncheck individual tests every time I run the VI Analyzer?
When I attempt to analyze a VI and all of its sub-VI, I get a configuration screen that lets me manually configure the tests used on each sub-VI. &nbsp; After saving the VIA configuration and later re-running, my configuration for the sub-VI test are not recalled. &nbsp; I do not want to disable the fialing test for the entire set of VI's only a choice few. &nbsp; An example is the Error cluster in the bottom left and right corners. &nbsp; I have a VI that is designed to insert extra text into the string of an error cluster and is customized to look like a type of "Con...

sub-VI and main VI
My main VI calls a sub-VI. I used the get control value (variant) to get the graph in the sub-VI, and output it to the main VI in a cluster. I set the maximum y scale in my sub VI, and it works. But when I get the graph in the main VI, my maximum y scale doesn't look right. Shouldn't I get the same graph that I got from my sub-VI. Is there a way to fix this? Thanks analog wrote: > My main VI calls a sub-VI. I used the get control value (variant) to > get the graph in the sub-VI, and output it to the main VI in a > cluster. I set the maximum y scale in my sub VI, and...

Problems compiling programs using wxWindows 2.2.9 using GCC-3.2.3
PLATFORM: Windows XP COMPILER: g++ Version 3.2.3 wxWINDOWS VERSION: wxWindows 2.2.9 Hi: I have successfully compiled wxWindows 2.2.9 on MinGW-3.0.0-rc4 [GCC Version 3.2.3] after commenting out the compilation of dynlib.cpp and fontenum.cpp (error at line 155) in the makefile.g95. The 2 source files were causing compilation errors which caused make to exit with an errnum of 1. My problem is this. A sample "Hello, World!" program - basic.cpp - fails during linking: C:\myzz>make 2>err g++ --pipe -c -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400 -D__WIN95__ -D__...

exicuting sub vi from a main vi
My main VI is based on a producer consumer pattern. In the main program I have the option on calling another VI that was created using the producer consumer pattern as well. I have a case structure with a Boolean switch on the front panel that selects the sub VI. When it is selected, it start running the sub VI but it waits for and event queue from the sub VI front panel before it actually executes. &nbsp; How can I have this start automatically, programmatically? If I understand you correctly, if you use named queues in your subvi, then you can fill up the queue with commands in the m...

The sub VI does not pass statistic vi data to the main VI numeric indicators.
The subVI is a Daq AssistantVI with a Statistic VI. Numeric indicators are wired to the statisic VI. A graph indicator is also wired to the signal from the Daq Assistant. The SubVI works by itself. Can not figure out why the numeric indicator and graph, that are wired to the connector pane, do not worked when wired to numeric indicators and graph in the main VI. Sarah, The only thing different in the samples you provided is, in my sub VI, the DAQ Assistant Express VI and Statistics Express VI are inside a case statement. The case statement is inside one frame of a flat sequence. This su...

Release free running subvi from grip of main vi so that both of them can be used simultaneously
Hi Labview Developers. I have a question: Once I opened&nbsp;and ran subvi from the main vi by means of menu bar. I would like to release the grip of&nbsp;the main vi from subvi so that both of them can be used during free running. How do I do that? &nbsp; Normally I would use while loop, event structure, runtime menu and while loop to open subvi. However as long as the subvi is still running inside one of the case in the evnt structure. &nbsp; How can I release it, not close or abort so that I can use both of them at the same time. &nbsp; Please advise Clement Hi Clement...

How do I link the output of the main VI to a sub-VI?
What I would like to do is to take the information (for example the error output), of a VI and get it into a subVI that I made. I don't quite understand how to call a sub VI (that I have made) and have the information go form the main VI to the sub VI. Thanks, Brian If your subVI should be called dynamically you have to use VI server and Call by reference node. Then you can pass the data via connector pane of this node. Regards Grzegorz SPRINTER Uzytkownik "relative0" <x@no.email> napisal w wiadomosci news:50650000000800000065AC0000-1066448259000@exchange.ni.com... &...

Pass cluster from main vi to sub vi?
Hello, I am currently working with a main VI which has about 30 controls that need to go to various sub vi's.&nbsp; I tried placing the controls in clusters and pass them to the subvis, to keep the code managable but have had no success.&nbsp; Is there a way to pass many controls through one input to a subvi? Thanks, Azazel Message Edited by Azazel on 11-18-2005 10:52 AM ...

sub vi in main vi front panel
Hi I have a sub vi and I want the front panel of that sub vi to be visible in the front panel of the main VI instead of opening in a seperate window.RegardsSimon Try using a subpanel... <a href="http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/loading_panel_in_subpanel/" target="_blank">http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/loading_panel_in_subpanel/</a> ~jc Thanks for that is there any way I can send data from the main VI to the subvi using subpanels? Hi vonzepp, to transfer data between parallel vi�s you can use queues or noti...

For loop stop in sub vi from main vi?
Hi! I want to control from my main vi a sub vi consisting of a stepped sine function generator. This sub vi has a for loop. The problem is that I want to have the option of terminating the loop in the sub vi from the main vi. I tryed using global variables&nbsp;or an event stucture. The problem is that, in both cases,&nbsp;the "stop" variable in my main vi is only updated after the loop terminates in the sub vi. Can anyone please help me? Thank you very much. &nbsp; Best regards, Diogo Montalv�o (Lisbon, Portugal) Hi Diogo, &nbsp;&nbsp;&nbsp;&nbsp;&nb...

Newbie question
Hi, This is a very newbie question on Java. I am doing the Java tutorials on java.sun.com and came across an example where I need to compile 3 java files (CreateObjectDemo.java which uses Point.java & Rectangle.java) at the same time. #Files are found at the end of the mesg# It says that I need all 3 files to compile. How do I do this? From the command line with 'javac'? Or can use the 'import' function in the CreateObjectDemo.java file? If yes, how? Thanks a lot! TS. CreateObjectDemo.java ===================== public class CreateObjectDemo { public static void m...

I want my application to have a main menu(vi) and few sub.vi...
I want my application to have a main menu(vi) and few sub.vi opened depending on state of few controls in the main menu. After finishing execution of the sub.vi, an exit button in the front panel of the sub.vi should bring back to main menu and of course the sub.vi should disappear. How to do that in labview 6i running uder windows 98 I want my application to have a main menu(vi) and few sub menu(sub.vi) opened depending on state of few controls in the main menu. After finishing execution of the sub.vi, an exit button in the front panel of the sub.vi should bring back to main menu and of cour...

How to close the main vi after entering into the sub vi automatically?
Hi, &nbsp;I have created 2 dialogs.I am trying to call one dialog from other as a sub vi. while calling the second dialog i want to close the first dialog automatically...how to do this? &nbsp; Please help me &nbsp; &nbsp; &nbsp; Regards Meenatchi Try this. MainVI.vi: http://forums.ni.com/attachments/ni/170/269432/1/MainVI.vi SubVI.vi: http://forums.ni.com/attachments/ni/170/269432/2/SubVI.vi ...

Open file in Sub VI and close in Main VI
Hi, &nbsp; Question: &nbsp; I am opening a file using a Sub-VI, but i am unable to close it in my main VI. Is there a way of passing the refnum between Sub-VI's ? Or is there a cleaner way of doing this ? &nbsp; Thanks GM ...

Open sub VI by clicking on indicator of Main VI
I have posted on this before. I got an answer that only confused me more, but I provided very few details on my previous post. I am going to be more specific in my post this time, because I need a&nbsp;solution that I can implement quickly, I AM ABOUT TO GET FIRED.&nbsp;I have not been programming very long (a few months) and&nbsp;this was the first real VI ihave built, so please be gentle when looking at it. &nbsp; My VI is used to monitor the position of a garage door while it cycles up and down. I am using a potentiometer on each door to determine its position. That part wo...

Looking for an elegant way to manipulate main VI from Sub VI
Currently the best way I can think of is to put a referance to every item on my front panel within a functional global. Every sub-VI then has programatic access to the front panel (using property nodes) and can manupulate it as things change. My problem is that this is not elegant. I devote half of my main program to placing the wires to move the objects into the functional global (57 wires into an array to be exact). If I want to add&nbsp;button on the front panel, I then&nbsp;have to break my code to add a new varaible.&nbsp;I was wondering what creative ways people handle this v...