NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

PostUUTLoop Does Not Execute When Terminating Before MainSequence

Solved!
Go to solution

I have some equipment I want to keep running between UUTs, so I initialize it in PreUUTLoop and free it in PostUUTLoop. During normal operation this is working as intended, but there are cases where PostUUTLoop is not executed and my equipment is left hanging.

 

Everything works in the case of an error or terminating during MainSequence. See the attached "MainSequenceError.seq"; when the error is generated, performing Run Cleanup gracefully quits the current UUT and allows the normal exit point, performing PostUUTLoop as expected. Using the Terminate hotkey during Main Sequence will also exit the UUT loop gracefully. PostUUTLoop will always run and can only be avoided with a hard Abort, which is acceptable.

 

This does not work in the case of a terminating during PreUUTLoop. See the attached "PreUUTLoopError.seq", during the error if you select Run Cleanup or use the Terminate hotkey during PreUUTLoop, PostUUTLoop will never execute.

 

Any suggestions on how to guarantee I can free my equipment after the UUT loop? I can think of a couple workarounds, but none are clean, such as suppressing termination during PreUUTLoop or moving my equipment initialize to Main Sequence and only execute on first call.

 

Thanks!

Download All
0 Kudos
Message 1 of 3
(102 Views)
Solution
Accepted by topic author Jeremy.Peterson

Taking a look at the TestUUTs EntryPoint pretty nicely explains what you are describing.

If you terminate during PreUUTLoop Callback, PostUUTLoop Callback will never be executed, since it is not in the cleanup section.

 

I strongly recommend using Process Setup Callback and Process Cleanup Callback. From what I understand from your use-case, this is the preferred solution.

Message 2 of 3
(77 Views)

That does the trick, thanks!

0 Kudos
Message 3 of 3
(66 Views)