NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get local variables to update?

I'm new to TestStand and I'm trying to use a post expression to store information into a local variable.  When I execute the sequence I use watch expressions to see if the local variables are updating as I expect, which they are.  The problem I now have is that after I execute a step within the sequence, that uses a post expression to update the locals, I find that the Local tab in the sequence doesn't reflect any changes.  How can I get this tab to update?  It would make my life alot easier while I'm troubleshooting.
 
A separate question I have is that I have a local variable of Boolean type that I can't seem to get to work.  I've got the string types working but the Boolean just won't update in the Local tab or even using the watch expressions.  Any help would be greatly appreciated.
 
Thanks in advance!
0 Kudos
Message 1 of 3
(3,755 Views)

Hi,

When you change the contents of a variable in the Post Expression during execution, its usually the Runtime version of the variable that you are changing.

When the execution completes, what you are seeing, when you select the Locals Tab, is the static version of the variable.

If you what is to change as well as the runtime version, then you have to change the static which is found at a different location.

eg.

You have boolean, myboolean" in the Locals of "MainSequence".

To change this value so that the static value is changed you would have to use an expression like

RunState.SequenceFile.Data.Seq["MainSequence"].Locals.myboolean = True

but you will also have to change the runtime version as well, eg Locals.myboolean = True

If you dont do this then your runtime version doesn't change but when you execution stop you will notice the static version will have changed.

I hope this helps.

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,742 Views)

Ray,

 

Thank you so much!  Your explanation worked flawlessly and I now have everything working as I had hoped.  Thank you again for your help.

0 Kudos
Message 3 of 3
(3,730 Views)