NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I store user input data and access it for my reports?

Solved!
Go to solution

Hello,

 

Im using: RunState.Root.Locals.StationInfo.StationID = Step.Result.Response expression in my Meassage Popup sequence, to obtain the station ID at runtime, and save it to my report. So far, this works.

 

Problem:

 

My goal is to buld an exectible thats deployed to other machines, wich will prompt a one time entry of the Station ID and used on all reports. e.g. even if I restart the execitable, for the program to look for this saved ID and place it in the report.

 

Where do I store the ID? How do I go about accessing it and inserting it to new reports?

 

 

0 Kudos
Message 1 of 4
(4,580 Views)

Powerbox,

 

This seems like the ideal use case for a StationGlobal variable. These variables are intended for station-specific settings which retain their values between executions.

 

Perhaps you could have code which says: If StationGlobals.ID is not set, display a box to set it. Otherwise, do not display the dialog.

0 Kudos
Message 2 of 4
(4,574 Views)

Thanks Daniel,

 

If I save the user input to my e.g. StationGlobal.ID variable, how do I get it from there to the Station ID field of my report?

0 Kudos
Message 3 of 4
(4,569 Views)
Solution
Accepted by topic author powerbox

By default, the data in the StationInfo container should be appearing in the report, so you can just have a statement similar to:

 

RunState.Root.Locals.StationInfo.StationID = StationGlobals.CurrentStationID

 

You would have this statement at the point in your sequence when you want to decide whether a prompt should be displayed to enter the ID if it does not exist.

 

Hope that helps, let us know if you have any more questions about it!

Message 4 of 4
(4,556 Views)