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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

FindFile - return file path in expression

Solved!
Go to solution

Hi,

 

What I'm trying to do is relatively simple, but I can't seem to figure it out.

 

I want to get the absolute path to a file contained in the TestStand search directories so that I can use the absolute path in the code module (to load a configuration file). I need to specify a bunch of name/path pairs in the code module.

 

I know that the FindFile function does this, but the path is returned as an output parameter, rather than the return value. Is there some clever way to get the output parameter returned in a single expression?

 

 

Something equivalent to this:

2018-05-01_11-01-55.png

 

Edit: I just tried specifying the file name as the path (in case TestStand automatically expanded the paths) but that didn't work.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 1 of 2
(2,446 Views)
Solution
Accepted by topic author Sam_Sharp

Aha!

 

Figured it out, this was the expression I used:

(FindFile("EXS_21xxxx.inf",True,Locals.FilePath,2,2)) ? Locals.FilePath : ""

(Obviously you have to create Locals.FilePath as a local variable)

 

Not sure if there's a cleaner/neater way (feel free to post if there is) but this worked for me.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 2
(2,441 Views)