cancel
Showing results for 
Search instead for 
Did you mean: 

file path from reference

Timothy 123
Member

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
15 REPLIES 15
Kenny_K
Active Participant

Re: file path from reference

Have you tried an invoke node and then using the method "VI Path" ???Smiley Wink
Kenny

Knight of NI

Re: file path from reference

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.
Kenny_K
Active Participant

Re: file path from reference

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

Timothy 123
Member

Re: file path from reference

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
Timothy 123
Member

Re: file path from reference

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.
TCPlomp
Trusted Enthusiast

Re: file path from reference

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!
Herbert Engels
NI Employee (retired)

Re: file path from reference

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
FTI_Newton
Member

Re: file path from reference

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

 

Scott_G
NI Employee (retired)

Re: file path from reference

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