NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Strip Path Function directly in TestStand?

Solved!
Go to solution

Hi,

 

I'm using TestStand 2013 an I'm searching for a "Strip Path" function, which can retrive path name and file name from a coherent path-string.

 

Such a function exists in LabVIEW but I didn't found any comparable in TestStand.

 

Kind regard

 

Christian

Christian

Test Engineering
digades GmbH
www.digades.com
0 Kudos
Message 1 of 5
(8,068 Views)

There is not a native one that I'm aware of.  I always use something like this:

Split((Split(Locals.Path,"\\")[(GetNumElements(Split(Locals.Path,"\\"))-1)]), ".")[0] //Get path name

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 5
(8,063 Views)
Solution
Accepted by C.D.

Hi,

 

To get the path of the currently running sequence (or any other ) try this in a statement :

Locals.sequencepath = Left( RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True) ),

 

To get filename from path you can use MSCORBLIB function.

 

Add a .net action step.

Select MSCORBLIB assembly 4.0

Select root class "System.IO.Path (not creatable)"

Select .net invocation as "GetFileName(System.String)"

 

Hope this helps.

 

Ravi

Message 3 of 5
(8,035 Views)

Hi together,

 

thanks for all your replies. Now I've solve the request like follow:

 

Locals.FilePath = Left(RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True))
Locals.FileName = Mid(RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, True, True)+1)

 

Kind regards

 

Christian

Christian

Test Engineering
digades GmbH
www.digades.com
Message 4 of 5
(8,007 Views)

RunState.SequenceFile.AsPropertyObjectFile.DisplayName

 

Will give you the sequence file name.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 5 of 5
(7,993 Views)