NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence File unload when execution starts and reference stays in memory through executions

Solved!
Go to solution

Hi !

 

I'm facing a problem using a dynamic sequence file load.

Here's how my application works : I'm testing products on two different test sockets so I'm using (a customized) parallel processModel.

When lauching a test on one or the other test socket, I always the same proces model client (MyProcessModelClient) in which I wrote a PreUUT call back to override the usual one. In this customized PreUUT, I'm getting the serial number of a product, and according to this number I'm scripting a test sequence file and saving it (TestSequence_1.seq if it's on test socket 1 and TestSequence_2.seq if it's on the other one).

Then in the MainSequence of 'MyProcessModelClient' I have a single sequence call calling TestSequence_1/2.seq dynamically according to the current test socket (TestSocket.MyIndex+1). This sequence call is then set with :

  • load option : load dynamically
  • unload option : unload after step executes

 

And here comes the trouble !

First of all, the code stored in my sequence callback 'SequenceFileUnload' of TestSequence_x executes when the file is loaded... (i guess this one is loaded, copied in memory and unloaded just after...)

Then, when replaying PreUUT for the next product on the same test sockets produces an error when my scripting code tries to the save the new TestSequence_x file (error -17206 : '... a sequence file with that path is already loaded') !

 

Any idea why is it behaving like that ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 5
(4,938 Views)

Hi zyl7,

 

I think what's happening is that you're not closing either the TestSequence_x.seq or it's completed execution. The unload option only refers to objects that are used by the sequence file, not the sequence file itself or it's completed execution. If after the socket execution completes, you close the associated TestSequence_x.seq and the completed execution of that sequence, you should be able to reload the new version of TestSequence_x.seq.

 

Hope this helps!

 

-Jack

0 Kudos
Message 2 of 5
(4,935 Views)

Hi Jack,

 

First of all thank you for your answer.

 

"I think what's happening is that you're not closing either the TestSequence_x.seq or it's completed execution."

=> TestSequence_x.seq is not the process model client, and is set to NOT be optimized for non-rentrant call. Moreover, in that sequence file I added a sequence callback 'SequenceFile Unload' which displays a simple pop-up. This popup appears when entering ( Smiley Indifferent ) in the sequence call to TestSequence_x.seq in my process model client. So for me it is a sign that the file is unloaded... no?

 

" If after the socket execution completes, you close the associated TestSequence_x.seq and the completed execution of that sequence, you should be able to reload the new version of TestSequence_x.seq."

=> The process model client is called using a parallel process model with TestUUt Entry Point, so as long as I'm testing UUTs the execution created for a test socket is active and retains my process model client loaded (and TestSequence_x image loaded too). If I manually close (I have to find the way to do this...) TestSequence_x execution, wouldn't it kill my process model and test socket execution ?

 

Is there any way to force TS to discharge the process model client after its Mainsequence executes ?

Am I facing this behavior because my process model client overrides the PreUUT callback ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 5
(4,923 Views)
Solution
Accepted by topic author CyGa

I'm not sure why you are seeing the behavior you describe and I am unable to reproduce with a simple example (which I've attached). Some observations/suggestions:

  1. Make sure you call Engine.ReleaseSequenceFileEx after you create and save the sequence file in PreUUT.
  2. The sequence file unload callback will be called when you release the sequence file after you save it in PreUUT because you are releasing the last reference to that sequence file.
  3. Make sure you are setting the OptimizeNonReentrantCalls to false on the sequence that you are calling in the TestSequence_x.seq.

-Erik

Message 4 of 5
(4,909 Views)

Hi Erik,

 

I just found the solution. The trick is on your thrid point :

"Make sure you are setting the OptimizeNonReentrantCalls to false on the sequence that you are calling in the TestSequence_x.seq."

But to more precise, this has to be done on each subsequence contained in the TestSequence_x.seq file. And not only on the MainSequence.

 

I tested you example, and it works fine concerning the SequenceFileUnload code...

So I took a better look at my scripter... In this one I'm scripting a new sequence file cloning some other sequence files... When I release the newly created sequence file, I didn't set the option to release whithout playing the unload callback... My code is now modified, and every is fine.

 

Thank you for your help.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 5 of 5
(4,904 Views)