LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Vi reference for Vis with same names

Using VI server, is there any way to open reference to a VI on the hard disk even thought a VI with the same name (but different path) is already loaded in memory? I'm trying to see if it's possible without renaming and making sure every single VI I use has a distinct name.
0 Kudos
Message 1 of 8
(2,945 Views)

Its not possible to place the vi's with same name in memory i tried doing so but either of the open refnums throwed error saying "not state compatible to run".

But i ran the vi's using call by referance in that case no error but there was racing codition!!!! you may not know which vi will execute and the result might be from any of the vi'sSmiley Very Happy

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 8
(2,934 Views)

abdel2 wrote: 

 I'm trying to see if it's possible without renaming and making sure every single VI I use has a distinct name.


I think we cannot do so even with VI Server. Smiley Sad

 

But, your above statement appears contradictory & confusing to me, in the sense, are you NOT going to rename or are you going to keep a distinct name for each VI? Smiley Surprised

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 3 of 8
(2,929 Views)

Right now I have two Vis with same name but different paths which is the reason why Vi server is opening reference to the wrong Vi. To fix it, I would have to rename one of them.

 

My goal is to create source distributions (SDs) for "modules" that can be implemented in my application over time. I can then run whatever Vis I want from the SD at runtime. Obviously, every single SD has to have Vis that have distinct names not just relative to the main application Vis but also Vis of other SDs that might be running in parallel. For now, I can give different names but as the # of modules increases, it will be hard to have some Vis that don't have the same name. Only other way I can think of to fix this is by creating an executable out of each SD and running it separately from the main application.

0 Kudos
Message 4 of 8
(2,919 Views)

abdel2 wrote:

 

For now, I can give different names but as the # of modules increases, it will be hard to have some Vis that don't have the same name.


It wont be tough to keep distinct names.

 

Just prefix or suffix your module name to the original VI name, so that you SDs will have VIs with same/similar functionality, but never conflict with each other when called during run-time. This is the procedure we follow in our project currently. We have gone ahead with the extent of packing all the DUT SDs (LLBs) into one complete auto-installer, so that in the target PC, everything get unbundled & installed into the appropriate folders that we have added while creating the installer.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 5 of 8
(2,915 Views)
An alternative to prefixing the names of the VIs would be to use project libraries.  If every module were in a separate project library, they would all be namespaced to those libraries, and you wouldn't have any name collision issues.  Note that project libraries are available in LabVIEW 8.0 and later.
Message 6 of 8
(2,903 Views)
Do you mean the LVLIB, Darren?
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 7 of 8
(2,901 Views)
Yes, Project Libraries are .lvlib files.  See the LabVIEW Help on Project Libraries for more info.
0 Kudos
Message 8 of 8
(2,871 Views)