NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access TestStand Local and Runtime variables from a VB program

I have instantiated and referenced an engine control, Loaded a sequence file, and called a sequence by name into mSequence. I declare mLocals as a PropertyObject.
mLocals = mSequence.Locals
Then I try:
mSeqRun = mLocals.GetValBoolean("SeqRun",0) where SeqRun is Locals.SeqRun in my sequence.
And even though I force a value in the sequence I always pull a zero.

The only Globals I can find is FileGlobals under SequenceContext. Are these the FileGlobals of the current execution?
0 Kudos
Message 1 of 3
(2,416 Views)
Bluto,

> I have instantiated and referenced an engine control, Loaded a
> sequence file, and called a sequence by name into mSequence. I declare
> mLocals as a PropertyObject.
> mLocals = mSequence.Locals
> Then I try:
> mSeqRun = mLocals.GetValBoolean("SeqRun",0) where SeqRun is
> Locals.SeqRun in my sequence.
> And even though I force a value in the sequence I always pull a zero.
>
> The only Globals I can find is FileGlobals under SequenceContext. Are
> these the FileGlobals of the current execution?

The following works for me:

Public Sub Foo(tsobjSequenceContext As TS.SequenceContext)
Dim tsobjProperty As TS.PropertyObject
Dim bValue as Boolean

Set tsobjProperty = tsobjSequenceContext.AsPropertyObject '

bValue = tsobjProperty.GetValBoolean("Locals
.SeqRun", 0)

Set tsobjProperty = Nothing
End Sub

Where tsobjSequenceContext is passed into the ActiveX DLL using the
ThisContext value from the TestStand sequence calling it.

Bob Rafuse
Etec Inc.
0 Kudos
Message 2 of 3
(2,416 Views)
Hi Bluto,

In addition to email below, and if you are using TestStand 2.0, you can have a look at the examples shipped with TestStand. These examples can be found inside the folder \Examples\AccessingPropertiesAndVariables\UsingVB. I have attached the VB code here as well. Hope this helps.
0 Kudos
Message 3 of 3
(2,416 Views)