NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid creating a variable to store a temporary value

This is an artificial example, but it best illustrates what I am trying to do:

 

I could create a local variable whose scope doesn't extend beyond the step, but I'd like to avoid that local variable clutter. Or I could dynamically create and delete properties in post expressions, but that would lead to variable names that are invalid at edit-time.  Or I could create a custom Sequence Call step type with a custom subproperty to hold the temporary value, but that is not a very generic solution.

 

But really, I'd like to just have two expressions I could use in the sequence Parameter and the Custom Condition that somehow each point to the other, to keep the rest of the step configuration as clean as possible (although the two expressions I am seeking may end up being more complex than the alternatives).  Is this possible?  I think it may be, but I can't figure it out.  One of the alternative solutions wouldn't kill me, but the solution I have in mind would be nicer!

0 Kudos
Message 1 of 2
(3,930 Views)

What you have seems to be the most clear solution to this.  For the dynamic case, if you are worried about errors, you may want to use #NoValidation.  Here's a paragraph from the linked document about using #NoValidation.

 

http://zone.ni.com/reference/en-XX/help/370052K-01/tshelp/infotopics/2012whatsnew/

 

You can now use the #NoValidation directive in an expression to disable evaluation error checking for part or all of the expression. Use this directive to suppress errors reported at edit time that will not occur at run time, such as using a variable the sequence creates at run time by using the TestStand API. Use this directive without a parameter list to suppress error checking for the remainder of the expression or pass a separate expression as the parameter to this directive to suppress error checking for only the parameter expression.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,906 Views)