From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

_OriginalInstancePath and Making Express VIs

Solved!
Go to solution

Inside each instance of an Express VI is a tag named "_OriginalInstancePath".  LabVIEW automatically manages the value therein.  It is the path to the original instance VI relative to the VI that owns the instance.  If you copy an instance of an Express subVI to another VI, LabVIEW fixes up the path; except if the destination VI is unsaved, in which case the _OriginalInstancePath remains unchanged.  For the built-in NI Express VIs this isn't a problem (probably because they're using symbolic paths to vi.lib).  However in my case the _OriginalInstancePath is something like "..\..\..\..\..\Common\GUI\BD Standard Dialog Box.vi"; which when combined with the <Not a Path> location of the unsaved VI results in <Not a Path> and then my configuration VI can't find the original instance.  I'm looking for ideas on how to have my configuration VI deal with this situation.

I'd rather not hard code the path because I'm averse to such un-robust code.

(I know that we're supposed to put our roll-your-own Express VIs in <user.lib> (which would probably eliminate the problem), but for source control reasons, I put them on Drive X:).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 2
(649 Views)
Solution
Accepted by topic author paul_cardinale

After pondering this a while, the solution eventually came to me, and then seemed obvious: Just use a static VI reference to the original instance VI and extract the path from that.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 2
(609 Views)