# NI TestStand

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## How to store a relative path in a global variable

Hi,

I'm using Teststand 2013 and Labview 2013

Is it possible to define a relative path for a global variable in the Teststand? Ex. "..\vector1.hws"

Or I should use the Labview functions to solve this issue?

.

Thanks,

Message 1 of 4
(3,764 Views)
Solution
Accepted by topic author engfpe

## Re: How to store a relative path in a global variable

Paths are so much easier to manipulate in LabVIEW.  So you could store the relative path as a string and then use LabVIEW to make the absolute path.

I typically store a folder in a global variable and then I can just concatinate the strings to build the absolute path.  For example:

FileGlobals.Folder = "C:\\foo\\bar\\",
Locals.Path = FileGlobals.Folder + "blah.txt"

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 2 of 4
(3,759 Views)

## Re: How to store a relative path in a global variable

If the file exists within your search directories you can use Engine.FindFile.

Also, you can use Engine.GetTestStandPath to get a base TS path and then make relative additions as crossrulz suggested.

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 4
(3,752 Views)

## Re: How to store a relative path in a global variable

Yes. It seems that it is easier to manipulate a file path in Labview.

I will store the file name in the TestStand variable and use the Labview to find the absolute path.

Thanks

Message 4 of 4
(3,739 Views)