LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refnum to path

Hi

I need to reload a VI through a front panel control. I want to obtain VI's path using the refnum to path function in order to  reload the VI using Load and Run. There is an error although according to the context window both source and sink are of same type.

 

 

 

 

P.S already checked detailed explanation

0 Kudos
Message 1 of 6
(2,891 Views)

that image is not very useful. Can you attach a simplified version of the VI instead? Where does the refnum come from?

0 Kudos
Message 2 of 6
(2,877 Views)

The refnum comes from the invoke method used to open a sub panel and wired to a shift register. 

Download All
0 Kudos
Message 3 of 6
(2,850 Views)

According to the help, "You can wire only file refnums to refnum". I don't think it is supposed to work with a VI reference.

0 Kudos
Message 4 of 6
(2,843 Views)

To explain a bit possible reasons for this constraint:

References are first of all only pointers to some space in memory; that means, they are only numbers where the actual number is the address in memory of the data space the reference is pointing to.

That being said, most references are completly incompatibel to a "path" or a "string". So casting a reference to a path or string makes only sense for references pointing to file-based data spaces, aka "file streams".

VI RefNum is not necessarily a "file stream" as you can acquire a reference to any VI you haven't saved yet, but is in memory. So it must not be compatible to a file-based reference (like a file handle you get from "Open File").

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 6
(2,818 Views)

Just use a property node:

 

VIRefnumToPath.png

Message 6 of 6
(2,785 Views)