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?
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 time.
Unless...
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.
Ed Dickens - Certified LabVIEW Architect Lockheed Martin Space Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
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.
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.
Ed
Ed Dickens - Certified LabVIEW Architect Lockheed Martin Space Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
The main "gotcha" is the seperate memory space issue mentioned earlier.
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.
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.
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.
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.