NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Station Globals through TS API

Hello,

I am using TestStand 2010 SP1 and LabVIEW 2011 SP1 to write items using the TestStand API. Specifically I am trying to update the value of existing StationGlobals using this solution method:

 

http://208.74.204.114/t5/NI-TestStand/change-a-stationglobal-variable-externally-from-a-LV/td-p/1947...

 

I have LabVIEW running with the intension to update Station Globals in a running instance of the sequence editor.

 

However, I am seeing what the original poster describes in that all I get is a prompt that "the stationglobals.ini file has been changed, do you want to reload...." and that does not show up until the LabVIEW program exits completely. Closing the TS.IEngine reference does not prompt the reload. 

Strangely if I explicitly use the IEngine.ReloadGlobals method, I neither get a message to reload nor do the values update.

 

I am suspecting that my IEngine reference is a different instance than the one open in SeqEdit.exe, do I need to obtain this reference, instead? If so, how do I get the reference to an open Seq Editor Engine?

 

Thanks,

Mello


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 1 of 6
(5,671 Views)

When you call the VI you can pass the engine in directly by using RunState.Engine.

 

OR

 

You can pass in the SequenceContext and get the engine from that.

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

Thank you for your answer Jigg,

 

I am realizing that I was unclear in my earlier description. The LabVIEW VI is not running from within TestStand. The VI is a user interface that does several different functions, one of which is to select sequences to open in the already open TestStand Sequence Editor. So, I have access to any ActiveX modules or the TestStand controls from within LabVIEW, but not the sequence context I could pass into any of my Action steps throught the LabVIEW adapter. Is there a way to start up a TestStand reference in LabVIEW to acquire the RunState.Engine through the ActiveX API?

 

Thanks,

Mello

 


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 3 of 6
(5,663 Views)

You can use a global teststand queue or notification to pass a COM reference such as the engine, between processes. See the following forum post for details:

 

http://forums.ni.com/t5/NI-TestStand/Capturing-Engine-pointer-from-external-App/m-p/1575530/highligh...

 

-Doug

0 Kudos
Message 4 of 6
(5,644 Views)

Mellobuck

 

Did you resolve this?  I have the same problem.  I use a container in my station globals to hold some info related to the selected test.  Only the Labview UI knows what test was selected so I'm trying to use the code below update the Station globals.  The code executes with no errors but the new values are updated in the station globals when I use them.

 

Capture.PNG

0 Kudos
Message 5 of 6
(5,408 Views)

You can use the "Automation Open" primitive in LabVIEW in order to open a reference to the Engine and then you can use the TestStand Engine as you would if you had passed the reference in. 

 

In Automation Open you have to browse to the TestStand API and select to create an instance of IEngine.

0 Kudos
Message 6 of 6
(5,366 Views)