LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file path from reference

Hi,

Is it possible to obtain the path of a file from its reference. If so, what vi is used to do this.

Thank you,

-Tim
Message 1 of 16
(7,892 Views)
Have you tried an invoke node and then using the method "VI Path" ???Smiley Wink
Kenny

Message 2 of 16
(7,883 Views)
I believe he's really referring to a refnum control, rather than a reference to a file path control. If it's the latter the question is somewhat moot, since the "Value" property will do that. However, for a refnum control, you can't wire that to an Invoke/Property node.

For a refnum control, use the "Refnum to Path" function under File I/O -> Advanced File I/O Functions.
Message 3 of 16
(7,873 Views)
I was thinking that it might be a VI reference.  I guess that we need the user to help us figure out which one it is.
Kenny

Message 4 of 16
(7,868 Views)
Hi,

Thank you for your replies. What I am talking about is the reference you get for example when you use the tdms streaming vis, such as tdms open. The input to this vi is a file output and one of the inputs is a reference to this file. Is it possible to get the file path back again from the reference.

Thank you,

Tim
0 Kudos
Message 5 of 16
(7,864 Views)
Hi,

Sorry what I meant to say is this:

The input to this vi is a file path and one of the outputs is a reference to this file path. Is it possible to get the file path back again from the reference.
0 Kudos
Message 6 of 16
(7,863 Views)
Tim,

Unfortunetly (how do you spell that?) the TDMS API in LV 8.2 has a bug that won't allow that function for files to work...

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 7 of 16
(7,859 Views)
You can work around this by saving the path as a file property right after opening the file. You can then retrieve it later in the code, when you actually need it. The is a rather dirty workaround in that the property won't update itself if you move the file around. I suggest you write it everytime you open the file and you set it to empty string everytime you close the file.

Hope that helps,
Herbert
Message 8 of 16
(7,845 Views)

LabVIEW 2009 now - has this issue been addressed by NI?

 

0 Kudos
Message 9 of 16
(7,475 Views)

I think the issue has been answered above, but nobody responded saying whether or not this is what they were looking for:

 

For a refnum control, use the "Refnum to Path" function under File I/O -> Advanced File I/O Functions

Scott G.
AE Specialist
National Instruments
Message 10 of 16
(7,445 Views)