03-10-2009 02:13 PM
I havedeveloped a custom TestStand UI in LabVIEW. However I have run into a smallproblem I wasn't able to tackle.
A useris allowed to load a sequence and then execute it. He can also stop theexecution. Load another sequence and run that sequence.
Inorder to conserve memory, when the user loads a sequence I automatically closethe previously opened sequences. However, I could not find anything to closethe executions. When I attempt to run the new sequence file, I find only thenew sequence runs, however, when I perform a thread count using the executions properties the total open threads is morethan 1. The running threads is 1. And the difference is the numberincomplete. Is there a way to remove these executions from memory so that thenumber incomplete goes to 0 and the count equals the running threads.
Thanks,
Amit
03-11-2009 12:06 PM
Amit,
The information in this thread should be useful.
Regards,
03-11-2009 12:38 PM
Ben,
That's not what I was looking for. I am able to terminate my sequences. Also they never run one I stop them. However, when I use the executions object and probe for the count, even closed executions show up in the number. Number running is correct. Given that this system may run for months at end and the user can change the sequence to be run any number of times, count will keep growing.
I found a work around for now but not a solution. When I create the new execution I choose 0x10 as the execution type mask parameters. This automatically closes the execution when I am done with it. This definately does what I want it to do,but it also means that I have to recreate the execution everytime I need to restart. Its strange that there isn't an option to destroy an execution on demand.
Amit
03-12-2009 11:56 AM
Amit,
I think I understand what you are looking for now. Your workaround is perfectly valid, but there is a better way. Before I explain that however, I would like to explain a few points.
1. At times, you seem to be using threads and executions interchangably. I believe that you know the difference, but it can be confusing to others trying to understand your question when you do use them interchangably.
2. The difference between the total number of executions and the number running is not the number incomplete. Instead, the total number of executions is the number of executions that are in the collection.
3. The number of incomplete executions is the sum of paused and running executions, thus it will never equal 0 because there is always one execution running.
To clean up completed executions, use the ApplicationMgr.CloseExecution after the Execution.Terminate or Execution.Abort has been called. This will have to be called for each Execution you have spawned. I have attached a screenshot of the step settings.
Hope this helps.
Regards,
03-12-2009 05:41 PM
Thanks Ben,
This seemed to work for sometime. I replaces close execution with close executions to ensure all executiosn are closed. However, I get an popup saying You have incomplete executions when I shutdown. My shutdown process involves Aborting (not terminating) all sequences. The close all executions. followed by a logout and engine shutdown and app manager shutdown. However I still get a pop up saying you have incomplete executions.
I am trying to run my UI so that no TestStand Popups show up. Is there a way to set testStand up that way?
Amit
03-15-2009 10:44 AM
I have tried the process I described to you with both Execution.Abort and Execution.Terminate and have not been able to duplicate your results. Are you certain that you aren't leaving an execution open somewhere? What happens when you close each execution individually with close execution rather than executions?