LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

seach for path

Solved!
Go to solution

Hi there,

 


I have a txt file with some configuration inputs to my labview application and i would like to kown if i can use a funtion to automatically search for that file path  wherever he is, or if i change my program and file to a new pc or location i want it to be able to repath without me manually inputing the path. Is it possible?

 

0 Kudos
Message 1 of 3
(2,126 Views)
Solution
Accepted by topic author asnaev

What you ask for is possible through one of two mechanisms:

 

  1. The text file is always in the same relative position to the calling VI.  In this case, you can build your path from the path of the calling VI by stripping and adding directories.
  2. The text file is always in the same absolute position on the computer.  There is no searching.  You can vary this by platform by using the conditional compile structure and keying off the operating system.

You can do an exhaustive search of the entire file system, but you would probably not like the performance impact.  Option 1 is usually the best bet.

Message 2 of 3
(2,107 Views)

I fully agree with DFGray.  Using relative paths is the way to go.  What you can do then is use the Application Directory node to get the location of the project/EXE and then build the path to your file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(2,097 Views)