NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I modify Search Directory using ProcessModel?

There are two different test groups in our company.  We are changing over to using TFS as source control.

 

I have modified all of the TestStand sequences to work with a Relative Path, took several weeks of work.

 

The other group needs to do the same thing, but most of their sequence files that call library routines are setup to use a single Search Directory entry (includes subdirs).  One of the complications with this implementation of TestStand, is that they often run multiple sessions of TestStand on the same computer.  We have found that you can modify the StationGlobals within each session and they will be kept separate.

 

Is it possible to use the method Engine.SearchDirectory.Insert in the Process Model so that each session of TestStand that is opened (which could be opened from different directories, i.e.: C:\Test Product1 or C:\TestProduct2)?

 

So, what I'm wondering is, could we read something within the ProcessModel (Report Path, Sequence directory, etc.) and use the Root of that path to build the Search Directory and enter that using a few step in the ProcessModel?

 

I'm suggesting the Process Model to make sure that the Search Directory is always modified, as opposed to having to call a special library function at the start of any session, to make sure that the Search Directroy is updated.

 

Mikef

 

 

0 Kudos
Message 1 of 3
(3,573 Views)

You can do anything you want to through the TestStand API.  However, doing this in the Process Model is not the right place.  Let me clarify though.  Doing this in the execution flow of the Process Model is not the right place.  Doing it in a configuration entry point might be ok.

The problem with doing it during execution is that when an execution starts a lot of your code modules get loaded into memory.  That's when it needs the search directories.  So by the time you get to the step you created in the process model to modify the search directories it may be too late.

 

Let me expound on my Configuration Entry point then I will propose an even better solution:
You could create a Configuration Entry poin in the Process Model called Set Search Directories.  Then put a model callback in there called SetSearchDirectories.  Then in the clients you can override SetSearchDirectories with code that will replace the search directories correctly.  The problem with this is that it has to be invoked by the operator through the Configure menu.  HOWEVER.....

 

If you need to switch search dirs on a production machine you can put the SequenceFileLoad callback and run the configuration entry point so the user does not need to click anything.  But they can click it if they need to.

 

 

If you are needing this just for the development benches I recommend creating a tool and putting it in the tools menu of the sequence editor.  We do this for our department.  We have a proprietary format for a file which gets generated by an optimizer.  Then you can just load that proprietary file associated with the client sequence file.

 

Hope this helps,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 3
(3,552 Views)

Jiggawax,

 

Thanks for the reply.

 

What we were trying to figure out is where the best place would be to update the Search Directories, and from your suggestion, the Process Model is not the place to do it. 

 

Guess we'll find another place, such as Comm Open, or something similar.  The thing we have to figure out is where this subroutine would be that would not require an explicit path (which may not exist).  Perhaps the TestStand Public or Components Directory.

 

Thanks,

 

Mike

 

0 Kudos
Message 3 of 3
(3,533 Views)