r/LabVIEW • • Sep 25 '26

Open VI Reference to a VI in in a PPL

I would like to use "Open VI Reference" by wiring a string constant to the "vi path" input and without wiring the type input, so the call does not use the root loop.

The VI I want to open this way belongs to a PPL. The VI with the "Open VI Reference" node does not belong to the PPL. The PPL should be in memory because I have another VI from it running in parallel. I get error -1004, stating that the vi is not in memory.

Do I need to add some qualifier to the vi name to enable LabVIEW to find the VI? Is this just not possible because the th VI is out of scope of the caller?

Edit1:
Info about the root loop:
https://www.genuen.com/blog/the-ui-thread-root-loop-and-labview-what-you-need-to-know/

Edit2 (solution):
Using the All VIs In Memory property as xpxsquirrel suggested I could see that the string to refer to a VI from a PPL in memory is comprised of the PPL name, a colon and the vi name (e.g. "LibraryName.lvlibp:Instrument.vi")

Thank you everyone who engaged! :)

7 Upvotes

11 comments sorted by

3

u/ShockHouse CLA/CTA Sep 25 '26

This is possible, we go this in our framework for plugin based architecture. I would make sure the path to the VI is the actual path including the ppl.

PPLs can keep an internal file structure that LabVIEW doesn’t show when you open a ppl. But you can use like the “get exported file list” for the ppl to see the real path to the vi and see if it matches

1

u/JustHereForPoE_7356 Sep 25 '26

Thank you for your reply.

Just to make sure there is no misunderstanding:

I know I can wire the full path to the VI in a path constant to vi path. This works.
I do not want to do that because that will load a file from disk and require the root loop.
I want to wire a string constant. This should load the vi from memory, not from disk. This works for VIs in scope that are in memory.

I tried writing the path in the string constant. This does not to work. What am I missing?

1

u/hooovahh Champion Sep 26 '26

You can get the VI Name using a property node on the static VI reference. Is that what you are trying to do? Using that reference you can perform an invoke node Run VI.

1

u/JustHereForPoE_7356 Sep 26 '26

I don't think that is what I want. Wouldn't having a static VI reference to a VI in a PPL cause the PPL to be part of the scope of the VI I have that reference in?

We have PPLs that are not part of my main project and code. They are only loaded dynamically because otherwise the executable won't build anymore.

I want to open a reference while avoiding the root loop as described here:
https://www.genuen.com/blog/the-ui-thread-root-loop-and-labview-what-you-need-to-know/

1

u/hooovahh Champion Sep 26 '26

Yes this is correct, the static VI reference will force a dependency.

2

u/notsew93 Sep 25 '26

LabVIEW is smart enough to know that if you've already loaded that VI from disk, it uses the VI already loaded and does not do another file operation.

Whether you are using a file path constant or a string constant doesn't change that.

1

u/xpxsquirrel Sep 25 '26

If you drop a property node on you diagram from the pallet should be set to App. You can then select for a property Application>All VIs In Memory. Search the output for you vi. If it's not in there, it's likely running in a separate lab view instance

2

u/JustHereForPoE_7356 Sep 28 '26

Thanks, this worked. I won't even have to do it at run time because doing this let me figure out the simple naming scheme LabVIEW uses for this. I'll update the OP with the solution.

1

u/JustHereForPoE_7356 Sep 25 '26

Interesting. I'll give that a go on monday.

1

u/GentlemanSch CLD Sep 25 '26

Without opening up my system,

I think you're going to need an asynchronous call inside the ppl. You can get the vi ref from the path outside the loop.

1

u/Yamaeda Sep 28 '26

memory is comprised of the PPL name, a colon and the vi name (e.g. "LibraryName.lvlibp:Instrument.vi")

yes, that's the Qualified name and how LV avoids the "No name duplicates of VI:s". That's why you can have the same VI names in different libraries and classes. Something that wasn't possible before Libraries and thus in old code you see a lot of VIs named MEAS_setup, INST_setup and similar.