NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not end teststand execution

Solved!
Go to solution

Hi everyone,

 

I've got a problem when exiting NI-Teststand from my .NET App.

Teststand is called from a form inside a thread. When I need to close the form (after sequence execution), I do :

 

_engine.ShutDown(false);
PropertyObject Obj = _engine.NewPropertyObject(PropertyValueTypes.PropValType_Container, false, "", 0);
Obj.SetValBoolean("logoutOnly", 0x1, true);
_engine.CallFrontEndCallbackEx("LoginLogout", Obj);
bool bRep = _appMgr.Shutdown();

 

When done, I've got an UI Message UIMsg_ShutDownComplete (which is good, I believe). Therefore, I'm ending closing the App :

 

_appMgr.CloseAllExecutions();
while (_appMgr.Executing == true)
{
    System.Threading.Thread.Sleep(1000);
}
_appMgr.CloseAllSequenceFiles();
while (_appMgr.SequenceFiles.Count != 0)
{
    System.Threading.Thread.Sleep(1000);
}

Controls.Remove(_appMgr);

_appMgr = null;
_engine = null;
_sequence = null;
_execution = null;

GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
this.Close();

 

Despite all this, I still have the attached message : "Application can not shutdown because you have incomplete executions". This baffle me alot.

 

Could someone give me an explaination (and maybe a solution ?)

 

Regards,

 

F.H.

0 Kudos
Message 1 of 2
(1,077 Views)
Solution
Accepted by FranckH

Hi, 

 

The are 2 shutdown stages for TS Engine!

This article sheds light on how it should be done:

Shutting Down the Engine - TestStand 2019 Help - National Instruments (ni.com) 

 

 

Roman

Message 2 of 2
(1,037 Views)