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: 

How do I access a sequence's local variables using ActiveX?

I created a very basic operator interface using the TestStand API. It creates a TestStand engine, gets the sequence file object, and gets the process model object. Then it is able to launch a new execution. And of course, it can shutdown the engine.

The interface also has a text message box to capture user input. I would like to assign this string to one of the sequences local variables. From the documentation, it seems that the best way would be to get the sequence context object and assign the variable that way. But I am having a problem getting this sequence context object. Where in the operator interface do I make the calls to do it? Before or after the engine execution call? ...and what call do I make to get
the context?

Hope this all makes sense. Many thanks,
Mark
0 Kudos
Message 1 of 2
(2,858 Views)
Hi Mark,

You will not be able to get the SequenceContext since you are creating an Engine object from within your development evironment (LabVIEW, CVI, etc.) If you want to write data back to TestStand, then you must obtain a reference to your sequence (Engine.GetSequenceFile -> SequenceFile.GetSequence)that conatins the local variable you wish to set. You will then use the AsPropertyObject method. Once you have done this, you can then use the Get/SetValXXX methods to set the value of the Local Variable, referencing it with a lookup string (i.e. Locals.NameOfVariable). Hope this helps.
0 Kudos
Message 2 of 2
(2,858 Views)