NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to RunState in C#

Hello to everyone,

 

I am using TestStand 2010 SP1 and Visual C# 2008.

 

In C# I use the TestStand API (NationalInstruments.TestStand.Interop.API).

I have a step in TestStand where I pass all the context to the C# code (NationalInstruments.TestStand.Interop.API.SequenceContext MyContext)

I know how to access to the StationGlobals, Locals, ... through these methods: MyContext.StationGlobals.GetValBoolean("BoolExample", 0);

 

My problem is:

 

For example, in TestStand I can access to a variable (that is a step of a subsequence) called RunState.SequenceFile.Data.Seq[0].Main.[0]

but I don't know how access to this part of the RunState... and also others...

 

Thanks to all of you.

Much thanks for your time and dedication!
0 Kudos
Message 1 of 2
(3,338 Views)

Either:

 

myStep = MyContext.SequenceFile.GetSequence(0).GetStep(0, StepGroup_Main);

 

or

 

myStep = MyContext.AsPropertyObject().GetPropertyObject("RunState.SequenceFile.Data.Seq[0].Main.[0]", 0) as NationalInstruments.TestStand.Interop.API.Step;

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 2
(3,328 Views)