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 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
(3,278 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
(3,278 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
(3,278 Views)