From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running the same VI twice

I am trying to run to same main VI twice simultaneously. I do not want the two main VIs to share information. They need to run totally independantly. I have copied the original VI and all SubVIs to a new directory, but when I load the second main VI it shares subVIs with the first main VI. How can I avoid this? I want them to run totally independantly.
0 Kudos
Message 1 of 4
(2,748 Views)
When you copied your main vi, you also copied the paths of the subvi's that it is using. So the copy of your main will call the original subvi's. If you show the vi hierarchy tree with full pathnames turned on, you will see that the subvi's are from the original path. You can tediously right click on each subvi in the block diagram, and select replace, then navigate to the new path. There may be a quicker way using Tools-Options-Paths-VI Search Paths. Maybe in you eliminate \* and/or \*, then close LV and open again, it may force you to find each subvi. Be sure to add what you had deleted in the VI Search Path. Perhaps someone else knows a quicker way than to replace each subvi.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,743 Views)
The \* didn't come out right. What I meant was to deleted foundvi and/or topvi from the VI Search Path.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(2,741 Views)
I think your problem is that you're trying to open VIs with the same name. LV can only hold one VI of a given name in memory at one time, so if you want the VIs to be completely different, you will need to rename all of them.
Another option would be to make all of them reentrant. This will mean that each place you call the VI will hold a seperate copy of the VI. You should make sure this doesn't affect the way your code works (for example, if you have a functional global, it will be affected by this).
I think the easiest way would be to make an EXE and then copy it and rename it. I believe that when running in the run time engine, you get seperate execution for each EXE, but I'm not at all sure of this, so you should check it.
If this isn't so, you can try merging the first two options.

___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,722 Views)