This widget could not be displayed.
This widget could not be displayed.

NI TestStand

This widget could not be displayed.
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?

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 1 of 5
(8,705 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.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 2 of 5
(8,703 Views)

Norbert, how I do this typecast?

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 3 of 5
(8,701 Views)

Use the function Str()

eg

 

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

 

 

Regards
Ray Farmer
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 4 of 5
(8,689 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.

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 5 of 5
(8,675 Views)