11-25-2014 05:18 AM
Hello,
In my UI, when I shut down TestStand, I have the following window which appear. It is because I have a SequenceFileUnload sequence in the sequence file which is opened. I wanted that this window doesn't display
When I close the TestStand editor with the same sequence file opened, the SequenceFileUnload sequence execute and TS close, whitout showing this window. I Would like to do the same in my UI
Any idea ?
11-25-2014 06:04 AM
This window appears if you initiate the shutdown of the TS engine while an execution is still running.
NI recommends to keep SequenceFileUnload callbacks to be "fast" during execution in order to prevent that dialog to appear. How long does that callback take in your use-case?
TS SequenceEditor has some additional stuff running compared to most of the custom UIs, so timing behavior is different. I assume that the SeqEdit is slower in querying for the engine to shutdown which will result the SequenceFileUnload to be finished before the SeqEdit really shuts down the engine. The custom UI seems to be a little faster, hence you see the dialog.
Conclusion:
a) Make SequenceFileUnload faster (reducing number of step, reduce functionality, improve runtime performance of modules called there, ...)
b) Add a little timeout between initiating shutdown and the last shutdown call
Norbert
11-25-2014 07:21 AM
With the second() function, I measure 0.2s in the editor and 0.05s with my UI. Not very long it seems to me
I put all my steps in SquenceFileUnload in skip mode and effectively, when I closed TS, no window appear. So this window appear when SequenceFileLoad execution is between 0 and 0.05s
Is there any means to change this value, or to force the choice 'Automatically Close Execution when Done' ?
11-25-2014 07:28 AM
Well, the best approach seems to be to customize the UI to leave more time for executions to finish before shutting down the TS engine for good.
Depending on the shut down reason, you can capture that in your UI, make TS to unload all files and then shut down.
Norbert
11-25-2014 07:36 AM
Yes indeed, I thought of this solution
When I leave my UI,
- close all sequences files
- wait for the end of SequenceFileUnload sequence execution (if any)
- shutdown the TestStand engine
I posted this question in the forum in case there was a simpler solution
Laurent
11-25-2014 08:36 AM
Laurent,
imho it isnt a question about "simple solution" but "safe solution". And i think that waiting for the Unload to finish sounds safe.
Norbert