NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract a file name / path from a local path variable in TestStand?

I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
 
After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
 
I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
 
Thanks,
Mike
0 Kudos
Message 1 of 6
(6,513 Views)

Hi,

There sound like functions in say LabVIEW or CVI.

I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)

Regards

Ray Farmer

Message Edited by Ray Farmer on 10-16-2006 10:04 PM

Regards
Ray Farmer
Message 2 of 6
(6,505 Views)

Thank you for your response.

I noticed that your sequence makes use of calls to the functions 'Find', 'FindFile', and 'Mid'. Where are these functions defined? What parameters do they expect? This is what is confusing to me because there seems to be lots of NI-developed DLL functions available to call from TestStand, but I can't find any documentation on how to call them or what they do.

Can you point me in the right direction?

Thanks,
Mike

0 Kudos
Message 3 of 6
(6,501 Views)

Mike,

These are built-in teststand functions. If you open the Expression Editor dialog, then press the browse button on that dialog.

On this dialog is two Tabs, one for accessing the various properties and the other for the functions. Select the functions tab. The Find and the Mid are find under Strings, and the FindFile is under Others. When you select a function on the dialog you will find help about that function, such as parameters list.

You will find more information under TestStand | Help.

Are you using CVI, Labview, VB with your TestStand?

Regards

Ray Farmer

Message Edited by Ray Farmer on 10-17-2006 06:37 AM

Regards
Ray Farmer
0 Kudos
Message 4 of 6
(6,489 Views)

Thanks Ray. I found them.

Currently I am only using TestStand, but I would like to know what built-in Labview/CVI functions are available, such as the DLLs in the C:\WINDOWS\SYSTEM32 directory (cvirt.dll is one for example). Do you know where these are documented?

Thanks,
Mike

0 Kudos
Message 5 of 6
(6,475 Views)
Hi Mike,

cvirt.dll is just the CVI run-time engine, used for running CVI adapter types. When you go to the functions tab which Ray pointed you to, you can click the Help button at the bottom to open up the Help file for TestStand specific to these functions. Hope that helps.

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 6 of 6
(6,463 Views)