From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Launching TestStand from OI using enviroment

Solved!
Go to solution

Hi,

 

I am test-driving TestStand enviroments option. Everything works fine so far, but I am stuck launching TestStand using an enviroment from LabVIEW.

Can anyone give advice?

 

Cheers

Oli

0 Kudos
Message 1 of 9
(2,911 Views)

Hey Oli, 

 

Could you be a bit more specific? Are you launching a TestStand operator interface from LabVIEW? 

 

If so, you can use the command line with the environment flag to launch a specific TestStand environment as shown in this help document. This tutorial might also be helpful for you.

 

Thanks,

Roxy

0 Kudos
Message 2 of 9
(2,899 Views)

 

 

Hi Roxy,

 

sorry. I have a proprietary OI written in LabVIEW. Today, I am invoking the Start method on the  TS AppMngr Ref.

2019-05-07 16_39_19-GUI_TS_Macros.lvlib_Open_Engine_w_Login.vi Block Diagram on TS_GUI_Complete.lvpr.png

But I haven't found a way to specify to specify the enviroment to use respectively to define command line parameters to use the /env option

Starting directly with the /env option from Command Line works fine.

 

0 Kudos
Message 3 of 9
(2,895 Views)

Are you trying to launch the LabVIEW test executive.exe?

 

 

Regards
Ray Farmer
Message 4 of 9
(2,886 Views)
Solution
Accepted by topic author Oli_Wachno

Hey Oli,

If you want to do this in the LabVIEW VI and not from the command line, first create an instance of EngineInitializationSettings and SetEnvironmentPath and set the environment before calling the AppManager.  Alternatively, depending on the rest of the scenario, you could modify the otherwise unused command line and let AppManager parse it like in this example

 

Let me know if I can help more! 

 

Thanks,

Roxy

Message 5 of 9
(2,884 Views)

@ Ray:

I have an executable programmed in LV which starts the TestStand to run the sequence. but I am starting TestStand using the API, not the command line.

@Roxy:

Thanks for the guidance, I have breifly checked the example and realize, I have to re-check my old libraries: the first thing I used to execute is IApplicationManger.Start . I am investigating where this is coming from, probably copied it from old examples.

I will try as you described.

 

Thanks for the swift help.

 

0 Kudos
Message 6 of 9
(2,863 Views)

After having spent a consoderable amount of time not working on this topic Smiley Sad

 

It took me some time to figure out how to create the EngineInitializationSettings object. So here is my solution:

Enviroment_dotnet.pngEnviroment_dotnet_constr.png

This approach seems to work when changing form <Global> enviroment to a specific one. Yet I haven't been able to change from a specific enviroment back to <Global>

 

I have tried:

  • Empty Path
  • Empty String directly wired to the input of the invoke node
  • Wiring <Global> to the input of the invoke node
  • Only calling the constructor without invoking SetEnviromentPath

 

Any hints?

 

Cheers

Oli

 

Message 7 of 9
(2,684 Views)
Solution
Accepted by topic author Oli_Wachno

@Oli_Wachno wrote:

This approach seems to work when changing form <Global> enviroment to a specific one. Yet I haven't been able to change from a specific enviroment back to <Global>

 


The Engine relies on initialization settings from the environment that cannot be changed once it is initialized. You have to close the application entirely and re-launch it with the correct environment. If you don't specify any other environment, it should use the <Global> one.

https://www.linkedin.com/in/trentweaver
Message 8 of 9
(2,646 Views)

@WireWeaver wrote:

@Oli_Wachno wrote:

This approach seems to work when changing form <Global> enviroment to a specific one. Yet I haven't been able to change from a specific enviroment back to <Global>

 


The Engine relies on initialization settings from the environment that cannot be changed once it is initialized. You have to close the application entirely and re-launch it with the correct environment. If you don't specify any other environment, it should use the <Global> one.


Understood, thanks. Everything is working as expected now.

 

Though I have to admit, I was not able to reproduce the error that was thrown, when connecting an empty string as enviroment path to the invoke node.

 

 

0 Kudos
Message 9 of 9
(2,628 Views)