NI TestStand

Showing results for 
Search instead for 
Did you mean: 

How to specify environment when using custom OI

Go to solution

Can you elaborate on why this didn't work?

I tried setting the "TestStand" environment variables of a cmd.exe instance to my AppData and PubDocs folders. When I ran seqedit.exe from that cmd.exe I was hoping the engine would use those environment variables and launch in a fake Global environment that I had overridden.

That didn't work Smiley Sad I guess seqedit has hardcoded Global environment settings?


How are the default folders setup?

0 Kudos
Message 11 of 16

Hold up...
That link you sent before had a snippet that I didn't think would work, but did.
I created an instance of IEngineInitializationSettings class in LabVIEW and used SetEnvironmentPath() before calling ApplicationManager.GetEngine() and it worked.
The instance of ApplicationManager was likely already loaded at the point where I called SetEnvironmentPath(), so I figured it would not work, but it did! So I can use that in my TSUI to set the environment.

0 Kudos
Message 12 of 16

You'll want to call it before ApplicationMgr.Start(). It should throw an exception if you try to set it after that.

0 Kudos
Message 13 of 16

Good tip!

0 Kudos
Message 14 of 16

Hi rfdecarre11, how do you create an instance of IEngineInitializationSettings class in LabVIEW?

0 Kudos
Message 15 of 16

EngineInitializationSettings.SetEnvironmentPath wrapper in the attachment.

Michał Bieńkowski

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
Message 16 of 16