NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get LabVIEW application instance(s) from TestStand

We have an existing LabVIEW TestStand GUI to load and run TestStand sequences. This GUI sets LabVIEW globals for certain options the user sets in the GUI that are obeyed by LabVIEW modules called by the sequence.

 

Now we would like to rewrite the GUI in C# .NET while maintaining compatibility with existing sequences and I can't see an easy way to do the above. What I think I need is a TestStand .NET API property or method to get the same LabVIEW "main" application instance used by the LabVIEW adapter in TestStand, so that I could do something like:

 

VirtualInstrument vi = labVIEWApp.GetVIReference(pathToGlobalVI);
vi.SetControlValue("Log To File", true);

But there doesn't seem to be a way to get any LabVIEW application instance references … unless somebody knows differently?

 

 

0 Kudos
Message 1 of 3
(1,953 Views)

What you are doing seems pretty convoluted and also a perfect example of why I am mostly against global variables.  However, this could be a lack of understanding on my part.

 

That being said have you seen this article: http://www.ni.com/product-documentation/14335/en/

 

It has been very helpful for me when trying to get the same application space for my sequence and my UI.

 

Hope this helps,

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

Your understanding is fine. Nobody like global variables, least of all me, and there are several better ways to pass data from a GUI to TestStand LabView modules, but compatibility is important although I am prepared to lose it if absolutely necessary.

 

Yes I have looked at the document you link to many times, it is quoted often in the searches I have done, but I don't see a way to force the accessed LabView globals to run in TestStand's main app instance. The most logical way would be to write a LabVIEW .NET dll that sets the globals and call it from C#, but of course DLLs always run in a different app instance, as specified by the document. My current workaround is to run a sequence file every time I want to set one of these globals, which works but is slow (and "convoluted").

 

Something like Engine.GetLabVIEWInstance("Main") would be ideal!

 

Thanks for considering it, anyway Smiley Tongue

0 Kudos
Message 3 of 3
(1,865 Views)