NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start TestStand ApplicationMgr in a NON-GUI C# modules

hello all,

 

We used to implement our test UI in C# windows form. We put ApplicationMgr ActiveX control on the form and the ApplicationMgr can be easily accessed and started.

 

Now we need to implement the UI in WPF and we have to seperate the UI and the Test Engine into different module so that the UI can call different type of Test Engines later. Therefore we have to implement the TestStand TestEngine module in a NON-GUI module. In this module we need to load a sequence file, run the sequnece file, collect test results and send back to UI to display.

 

To implement this module we have a lot of questions:

1. Is ApplicationMgr a must-have for our purpose of loading, running sequence and getting test results?

2. Can AppliactionMgr be created in a NON-GUI module?

3. Can we use

NationalInstruments.TestStand.Interop.UI.Applicati

onMgr myApplicationMgr = new NationalInstruments.TestStand.Interop.UI.ApplicationMgr();

myApplicationMgr.Start()


to create and start the ApplicationMgr? We have tried, but unfortunately it is not working. What did we miss?

4. Is the ActiveX control the only way to access the ApplicationMgr? For NON-GUI module, there must be a way that we didn't find yet. Anyone have help us point to a right direction? If some example code would be great!

 

Thank you very much!

Regards,

Message 1 of 4
(4,723 Views)

The ApplicationMgr makes a lot of things simpler, so I highly recommend you use it even if you aren't displaying a UI with it. You can create the control on a hidden form as follows (assuming your thread is an STA thread):

 

System.Windows.Forms.Form hiddenForm = new System.Windows.Forms.Form();
NationalInstruments.TestStand.Interop.UI.Ax.AxApplicationMgr appMgr = new NationalInstruments.TestStand.Interop.UI.Ax.AxApplicationMgr();
((System.ComponentModel.ISupportInitialize)(appMgr)).BeginInit();
hiddenForm.Controls.Add(appMgr);
((System.ComponentModel.ISupportInitialize)(appMgr)).EndInit();

 

This way you can use the ApplicationMgr without showing anything to the user.

 

Hope this helps,

-Doug

Message 2 of 4
(4,718 Views)

Hi dug9000,

 

Thank you for your advice.

Because we use WPF instead of Winform. How to do it by using WPF?

 

Regards,

0 Kudos
Message 3 of 4
(4,677 Views)

I believe the code I gave you will work in a WPF project too, you just need to also add a reference to System.Windows.Forms. I'm not sure whether or not WPF can directly host activeX controls.

 

-Doug

0 Kudos
Message 4 of 4
(4,657 Views)