NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning a result to two variables

I am trying to assign a string result from a step to two seperate variables, namely Step.Result.ReportText, and a local or file global. I can do this with a post expression, but it would be convenient just to do it with an expression tied to the output of a vi.  I haven't been able to find any expression syntax that works. Does anybody know if this is even possible?

I need the expression to do the following:

 

Assign the output of a vi to Step.Result.ReportText

And

Assign the output of the same vi to FileGlobal.XXX

 

Any hints?

0 Kudos
Message 1 of 6
(6,714 Views)

This isn't possible.  I don't know of any language that allows you to assign one parameter to 2 variables.  Interesting concept though.

 

I would just use the local variable and then in the post expression assign that to the report text as you mentioned.  Why are you against that?  Just curious.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(6,682 Views)

You can do something like locals.a = locals.b = "blah" in an expression.  That will assign the value to both variables.  But coming straight from a code module, things don't work that way.  Equations just don't work on module outputs.  I'm with just leaving it in the post expression.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(6,678 Views)

Jigg,

I want to use the content of the Step.Result.ReportText in a post step callback, but as soon as I step into the callback the step properties for the calling step go out of scope and are not accessible. The file global gets around that, so if I could have assigned the desired text to both spots in one fell scoop it would have saved me a little time. Looks like a post expression is the way to go.

0 Kudos
Message 4 of 6
(6,660 Views)

@rimfire44 wrote:

Jigg,

I want to use the content of the Step.Result.ReportText in a post step callback, but as soon as I step into the callback the step properties for the calling step go out of scope and are not accessible. The file global gets around that, so if I could have assigned the desired text to both spots in one fell scoop it would have saved me a little time. Looks like a post expression is the way to go.


You could try PreviousStep.Result.ReportText



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(6,657 Views)

PreviousStep won't work like that in a substep.  Pass in the sequencecontext to the substep.  Then you should be abel to access report text of the step.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 6
(6,623 Views)