NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing Test Stand engine's internal cache

I am trying to clear the TEST STAND ENGINE'S internal cache of past sequence files in a custom Operator Interface I am developing using VB.NET.  The scenario is as follows.   The Test Stand OI application is instantiated from a desktop shortcut that also has the sequence file as a parameter.  I am using only the "Single Pass" entry point.
 
The problem is other sequence files appeared to be executing in addition to the sequence file passed in as a command line argument.  I checked this by creating an event handler for the openseqfile event and putting a VB.NET debugger breakpoint at its start.  In the case I checked the seq open event fired 3 times.  Once for each of the last 3 different sequence files I tried to run.   I checked each of the files as they were being opened and the 1st file opened was the one I passed in.  The second file opened was the one I ran prior to the current application instantiation.  I checked that file an the "e.file.IsExecuting" property was TRUE!  How could that file be executing when the application starts when it is not even the file I want to run?
 
The third file was a file I ran 2 instances ago and its "IsExecuting" property was false and its "CanUnload" property was true.  I was able to remove that particular file with "Me.AxApplicationmgr.GetEngine().ReleaseSeqenceFileEx(e.file)" in the event handler.
 
What is the proper way to remove (clear) the interneal cache.  So only the single file I want is opened?  Thanks
0 Kudos
Message 1 of 4
(4,163 Views)
In your OI before the call to ApplicationMgr.Start(), set ApplicationMgr.ReloadSequenceFilesOnStart to false.
Message 2 of 4
(4,162 Views)

It worked great. Thanks.

Where is the proper place (event) to release a sequence file attained by a me.axApplicationMgr.GetEngine().GetSequenceFileEx(path)?  I'll be using me.axApplicationMgr.GetEngine().ReleaseSequenceFileEx(file).  In my case I want to allow the operator to re-run the application with the same sequence file, but if the operator decides to exit the application (operator interface) I want to do the proper housecleaning.  Thanks again.

JJT
0 Kudos
Message 3 of 4
(4,152 Views)

You should call ApplicationMgr.OpenSequenceFile instead of Engine.GetSequenceFileEx (see TestStand Reference Manual>> Chapter 9 Creating and Customizing Operator Interfaces >> Using the TestStand API With TestStand UI Controls).

If you want to close the file explicitly, call ApplicationMgr.CloseSequenceFile.  If you don't close the file, the ApplicationMgr will close the file automatically when your application shuts down.

When you call ApplicationMgr.OpenSequenceFile, the file appears in controls that display the list of open files and your application receives an ApplicationMgr.DisplaySequenceFile event for the file.

If you can't use the ApplicationMgr methods, then I think the place to call Engine.ReleaseSequenceFileEx would be in the ApplicationMgr.QueryShutdown event (also see TestStand Reference Manual>> Chapter 9 Creating and Customizing Operator Interfaces >> Using the TestStand API With TestStand UI Controls).

 

0 Kudos
Message 4 of 4
(4,136 Views)