NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

adding a variable in a Message Popup

Hi guys, how to get a local variable in a message Popup? I try "string text"+ Runstate.Caller.Locals.foo ... Coz runstate is while program is running, Caller is the calling step and then local variable.

 

But this give an error. Where to access my local variables while running?

0 Kudos
Message 1 of 5
(8,317 Views)

First of all, it depends on the data type of the variable. String can be added "similar" to the way you described. Numeric and boolean has to be cast.

 

Second, you seem to misunderstand the concept of the RunState-property. If you want to insert a local variable of the sequence you are currently running, the expression should be:

"My Dialog Text " + Locals.<localname>

 

Don't forget type casts if not working with string variables!

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(8,315 Views)

Norbert, how I do this typecast?

0 Kudos
Message 3 of 5
(8,313 Views)

Use the function Str()

eg

 

"The value is " + Str(Locals.Reading, "%d") where Locals.Reading is a Numeric

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 5
(8,301 Views)

Just to clarify, RunState.Caller is the caller of the -sequence- you're in, not the caller of the Message Popup. The help file has pretty good explanations for the majority of the RunState sub-properties.

0 Kudos
Message 5 of 5
(8,287 Views)