NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

In popup step how do I get the "text on the button" in the report rather than button index?

(1)
How do I configure the POPUP step in "SEQ MAIN.seq" to execute the second
step (IS OUT PUT IS 20?) in "SEQ 1.seq" when "IS OUT PUT IS 20?" button
hit and execute the third step (IS OUT PUT IS 30?) in "SEQ 1.seq" when "IS
OUT PUT IS 30?" button hit.

(2)
In popup step how do I get the "text on the button" in the report rather than button index?

File attached
0 Kudos
Message 1 of 6
(4,210 Views)
In Main sequence, create a local variable, call it ButtonHit. In first step, create post expression with Locals.ButtonHit = Step.Results.ButtonHit. Next create a sequence call after the first step. Make this step call the Seq1 sequence. Create a precondition of Locals.ButtonHit==1. This step will only call Seq1 when the first button is hit. Then create another sequence call step, calling the Seq2 sequence. Put in precondition of Locals.ButtonHit==2. To get the button text use the variable Step.Button1Label or Step.Button2Label, both are string types.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 6
(4,211 Views)
The handle to the Step.Button1Label gets you the data, but there are several ways to get it into the actual report.
The easiest is to use the reporttext.
In a post expression, you can use something like


Step.Result.ReportText = Evaluate("Step.Button" + Str(Step.Result.ButtonHit) +"Label")


and then the default report generation will include it in the report. Otherwise, you need to get the text into the Resultlist by various means (check the user manual, or the TestStand II customisation course) and handle the report generation yourself inside of the appropriate sequence in the process model.

Just my 2cents
S.

// it takes almost no time to rate an answer Smiley Wink
Message 3 of 6
(4,210 Views)
MR SSL,

Sacha and tBob have the right idea. Using their suggestions, you should get the label in the report and correctly execute a sequence depending on the button the user pushes.

If you are wondering about other ways to add the text of the MessagePopup button to the report, a common solution would be to make a custom step type. This might be overkill for a small example of using the MessagePopup step type, but there are some examples that demonstrate this online. Simply search for "+creating +teststand +waveform +step +type" and you'll find two examples (one in LabVIEW and one in LabWindows/CVI). Creating a custom step type is only one way of many to add data to the report. As Sacha mentioned, I'd recommend looking at the TestStand User
Manual or the TestStand II course for more information on all of the methods.

Hope that helps!
Regards,
Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,210 Views)
I do what you suggested ... 
 
create post expression with Locals.ButtonHit = Step.Results.ButtonHit. Next create a sequence call after the first step. Make this step call the Seq1 sequence. Create a precondition of Locals.ButtonHit==1. This step will only call Seq1 when the first button is hit. Then create another sequence call step, calling the Seq2 sequence. Put in precondition of Locals.ButtonHit==2
 
However, in the post expression, the syntax checker tells me ...
Expected Boolean, found Number. [Error Code: -17308, Specified value does not have the expected type.]
 
I don't understand how this is possible, when the local variable I created is of type Number and Step.Result.ButtonHit is a Number.
0 Kudos
Message 5 of 6
(4,024 Views)
Maybe you should post your sequence. Here's one that works.
Message 6 of 6
(4,017 Views)