NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practices: search directories and project hierarchies

Solved!
Go to solution

Hello,

 

I'm wondering what conventional wisdom says about structuring a TestStand project.

 

When I develop a LabVIEW project, this is the general structure I use:

 

  • Root folder\
    • My LV Project.lvproj
    • Main.vi
    • Functionality1\
      • Sub1a.vi
      • Sub1b.vi
    • Functionality2\
      • Sub2a.vi
      • Sub2b.vi

 

For my first TestStand project, I used this structure to separate my TestStand bits from my LabVIEW bits:

  • Root folder\
    • My TS Workspace.tsw
    • My TS Project.tpj
    • Main.seq
      • Sub1.seq
      • Sub2.seq
    • LabVIEW Backend\
      • My LV Project.lvproj
      • Test1.vi
      • Test2.vi

 

Unfortunately, every time I add an Action or Test and select my .lvproj file, TestStand tells me "The file you selected does not reside in any of the search directories."

 

So far, I've opted to "Use a relative path for the file you selected" every time, but this is not an optimal workflow. "Add the directory that contains the file you selected to the list of search directories" seems to be the pain-free option, but from what I understand, search directories are system-wide; I only want to add this directory to this TestStand project.

 

What are your thoughts? How should I manage my projects? Would these choices affect what I need to do to deploy the software on my customer's PC?

 

 

Thanks!

Certified LabVIEW Developer

0 Kudos
Message 1 of 3
(2,949 Views)
Solution
Accepted by JKSH

You need to use relative paths for the modules that you use instead of depending on search directories.

 

For example if you sequence is in c:\Model1\temp1.seq

and your LV or DLL can be in c:\Model1\supportfiles\a.vi

 

Then for the LV action step type in the temp1.seq you can give supportfiles\a.vi as the path or supportfiles\a.lvproj if its a project.

 

When you copy/deploy the Model1 folder to your customers place then the sequence will automatically work ( no need for search directories and easy to deploy).

 

The problem with search directories is it is confined to your machine only.

When you deploy the test sequence at your customers place it will be an issue.The test sequence will fail to find the required dll\vi if it depends on the search directories.

 

As for the trouble of each time selecting the project and clicking on the relative option - you can use templates.

Here is what i did :

Add an action step type and selected the a.lvproj ( selected the relative option when prompted for).

Added this action step type to templates ( drag it to templates on the left bottom window - under steps).

Keep on adding action steps from this templates.

Now it will not ask for the relative path again.

 

Hope this helps.

 

Ravi S

 

 

 

 

Message 2 of 3
(2,948 Views)

I recommend specifying your code module files (e.g. lvproj and vi files) relative to your sequence files. That way you can change your root folder without affecting anything and you don't have to add any search directories.

 

For this to work best, the files need to be in a directory underneath the sequence file in which it is specified or in the same directory as the sequence file.

 

If the code module is directly in the same directory as the sequence file, you will not be prompted to use the relative path, it will automatically do so. If it's not you will be prompted for a relative path, but that should be the default and you can just click the ok button. If it's above the sequence file's directory then the file browse dialog is no help for specifying relative to the sequence file because it will not do paths with "..". You can manually type paths with .. in them though.

 

Alternatively, using a search directory might be reasonable in your use case if most of your code modules are in the same LabVIEW Backend directory. You are correct though that there is not currently a per project or per sequence file way to specify search directories. One alternative I might recommend is that you have a single search directory (i.e. "LabVIEW Backend"), do NOT make it recursive, and add subdirectories for each of your teststand projects for which you want different code modules and specify your code modules with a more complete relative path such as: <subdir_under_searchdir>\myvi.vi

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 3
(2,933 Views)