From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

using goto with message popup

I have a sequence that calls a VI that reads a hardware register and verifies that the operator has connected the proper UUT before running the core tests.  This may not be the best way to handle what I want to do, but this is what I've done so far.  I call the ValidateUUT VI followed by an if-statement that has a condition of PASS ValidateUUT.  My question comes in at the Else portion.  If the Else happens, I display a MessagePopup informing the user of the trouble and I ask if they'd like to 'Retry' or 'Exit' (those are the names I assigned to the two buttons within my message popup).  I placed a label 'UUT Validation' before the Validate ITA step, and a label "End Test" just after the Message Popup.  What I wanted to do was goto label 'UUT Validation' if the user clicks "RETRY", and goto (fall through) label "End Test" if the user clicks Exit.  I'm not sure if I've taken the best approach, but how do I do (one way or another) what I want to do?
0 Kudos
Message 1 of 9
(5,462 Views)
I wont comment on the best solution but I will suggest that you can set where a step goes by using the "Post Action" settings from the properties menu for a step.  There you can specify a custom condtion and then go to any step in your sequence depeding on the boolean result of that custom condition (for example if button retry is press go to step X)
0 Kudos
Message 2 of 9
(5,456 Views)
The post action (1) requires an expression that I just can't figure out.  I'm trying to say "If button labeled "RETRY" was clicked, goto label "Retry Validation", else goto "Test Complete".  I cannot get the syntax correct. (2) I was allowed to attempt an expression because I checked the box labeled "Specify Custom Condition".  However, in addition to the Custom Condition Expression, I see two drop downs (On Condition True and On Condition False).  If I could get the custom expression to work, this might be ok for me in that the Destination Step allows me to point to a label.  I'm wondering what I would do, however, if I had 3 or more buttons on my message popup and needed them each to take a unique route.  Would I even use the Post Actions option? (3) If I right-click the message popup step and select Edit Message Settings, I see the Button Label Expressions for the two buttons (RETRY, EXIT) that I'm trying to handle.  When I select the f(x) beside either Button (1 or 2), the Expression box shows me the text inside the button.  HERE is where it would make sense that I could type a simple expression that says Goto label "Retry Validation" or Goto label "Test Complete".  Obviously the syntax is not correct (which is why I'm here in the first place).  Isn't there some simple solution like that?
0 Kudos
Message 3 of 9
(5,407 Views)
When I select the edit message popup, I see the dialog (attached).  If I select f(x) and type Step.Result.ButtonHit==1?True:False, it errors, saying 'expected a string'
0 Kudos
Message 5 of 9
(5,385 Views)

Hi,

Are you trying to replace 'Step.Result.ButtonHit==1?True:False' for the text in the buttons eg RETRY?

What are you trying to achieve?

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 9
(5,373 Views)
That IS what I was trying to do.  I don't know where else to insert the suggested expression.
0 Kudos
Message 7 of 9
(5,363 Views)

The link I posted was for how to write a post action expression. This where you said you had a problem with defining the expression. The f(x) button next to the label is for defining an expression that creates the label text. It doesn't make sense (at least to me) that you could use this for defining post actions as well.

Have you looked at any of the shipping examples of TestStand? In my 3.1 version, there are two in the Examples\MessagePopups folder. Either one of them should give you an idea on how to handle multiple buttons. You can also write Step.Result.ButtonHit to a local variable as the step's Pos-Expression.

Message Edited by Dennis Knutson on 02-19-2007 07:31 AM

Message 8 of 9
(5,364 Views)

Hi,

Another example to look at is the sequencefiles in the examples\callbacks, particularly the SequenceFilePostFailure sequence file as this uses the result from the Message Popup to perform the repeat of a Step, Continue etc.

Regards

Ray Farmer

Regards
Ray Farmer
Message 9 of 9
(5,353 Views)