NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

.Net app hangs when using ApplicationMgr and Engine

I am writing a .Net WPF app to generate a TestStand app.  I create an ApplicationMgr object and get an Engine object from that (appMgr.GetEngine).  When I terminate my app, it hangs.  Through a series of experiments, I have traced this to the Engine object.  If I comment out its creation, my app terminates fine.

 

I wanted to try calling the various CloseXXX and Shutdown methods, but my app isn't getting far enough to invoke them.  For example, my app hangs while shutting down the main window and I do not have any means (destructor, Dispose, etc.) to call those methods.

 

Am I not using the ApplicationMgr and Engine in the proper way?  Is there something else I need to call?  An option I need to set?  Regarding how I create the objects, it is nothing special:

 

_appManager = new ApplicationMgr();
_testStandEngine = _appManager.GetEngine();

 

 

0 Kudos
Message 1 of 4
(2,434 Views)

Are you starting the AppMgr?

 

https://zone.ni.com/reference/en-XX/help/370052W-01/tsuiref/reftopics/applicationmgr_start_m/

 

This is what actually starts the engine and gets the proper licenses.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(2,416 Views)

I am not calling Start.  I only instantiate the ApplicationMgr, then the Engine.  The Engine works fine (creates files, add properties, etc.) other than my app hangs on termination.

 

I looked at the link.  I tried setting the various properties (LoginOnStart, IsEditor) mentioned and calling Start.  It throws an exception (Error code -17500, "Operation failed") when calling Start regardless of how I set the properties.  

 

My app is self-contained: I do not need any of the TestStand UI, I only need the Engine. 

 

I tried creating an Engine object without the ApplicationMgr.  Everything runs (no crashes, hanging…) but I get no files (workspace, project, or sequence).

 

Is there a way to use the Engine without using the ApplicationMgr?  The only reason I am using it is because this is how NI's examples are written.

 

 

0 Kudos
Message 3 of 4
(2,386 Views)

I create applications all the time, in LabVIEW, that only use the engine and not the AppMgr.  So it is definitely doable.

 

Because the engine is an activex component and it is a creatable object then you can just call new Engine().  As long as you include the TestStand API namespace.

 

Hope this helps,

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 4
(2,380 Views)