NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding the context and scope of variable containers

First let me apologize up front if I mess up the names or order of the variable containers. I am going from memory and cannot find a picture of the variable pane on the NI web site to reference. In the variables pane of the development environment, there is "Step." , "Runstate." , "ThisContext." variable containers. What is the difference in context, scope, or dynamic vs static of these variable containers? The reason I ask is that if you look at the Runstate container, it has a step container in it. Further, if you look inside the ThisContext container, you see that it contains a runstate container inside of it. Are these just copies of the same memory space? I am not sure why I would reference or use one versus the other or when I would use one vs the other. 

 

I hope this makes sense.

0 Kudos
Message 1 of 2
(3,271 Views)
I'll start with "Step". This property gives you access to the currently selected/executing step.
It will only appear in the Variables pane when you have selected a Step.
When you are executing a sequence it will show the currently executing Step.

"ThisContext" is a Pointer/Reference to the current SequenceContext (itself).
If you look at its contents it will show you exactly what you see from the top level of the tree.
You are correct that "ThisContext.Step" is exactly the same as "Step"
Basically you only ever need to use this to pass the current SequenceContext to a CodeModule.
(eg, to pass the SequenceContext to a LabVIEW VI)

"RunState" give you access to EVERYTHING thats going on in TestStand.
Including the Current SequenceContext.
"RunState.ThisContext" is exactly the same as "ThisContext"
Basically you never need to use this.
If you need the current SequenceContext use "ThisContext"

Hope this clears up a few things.
Simon Holman
Software Engineer
Certified LabVIEW Developer
Certified TestStand Developer

measX GmbH & Co. KG.
http://www.measx.com
0 Kudos
Message 2 of 2
(3,262 Views)