NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

deal with teststand message popup

when I add a message popup in my sequence,I need two button: Ok(button1) and Cancel(Button2).and set timeout.

My question is like this; I need get the status when execute,if uesr click ok,the sequence should go to next step,the other stauts,the sequence should abort executing.

example:

Message Popup

if(RunState.Sequence.Main["Message Popup"].Button1Label=="OK")

   call sequence   //this action need execute when click "OK"

else

   break        //this is a action ,without any connection of message popup

end

but no matter what button I click ,the sequence always execute break,that's means the if condition can't get the status of message,where is my error.

any one help me ,thanks very much

 

Message 1 of 22
(8,317 Views)

Hi,

 

You need to use

if(RunState.Sequence.Main["Message Popup"].Result.ButtonHit == 1)

 call sequence

else

 break

end

 

RunState.Sequence.Main["Message Popup"].Button1Label will always equal OK but the string is actually ""OK"" which is why you are seeing it as false.

 

hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 22
(8,315 Views)

Hi Ray,

 

I have a need to get the label of the button pressed.  (in this example to read "OK" or "Cancel".  

 

How do you do that?

 

Thanks

Rafi

0 Kudos
Message 3 of 22
(8,122 Views)

Hi,

 

If you are getting the value in the pre or post expression of the MessagePopup step then use (as an example):

 

Locals.Buton1LabelString = Step.Button1Label.GetValString("",0) this will return ""OK""

 

likewise for Button2.

 

If you are getting the value outside of the step eg in a step before the MessagePopup step then try

 

Locals.Buton1LabelString = NextStep.Button1Label.GetValString("",0) this will return ""OK""

 

Hope this helps

 

Ray

 

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 22
(8,114 Views)

Hi Ray and thanks,

 

My meaning was to obtain the label of the key which was pressed by the user, not the lable of button 1 or 2.  

 

Thanks

Rafi

0 Kudos
Message 5 of 22
(8,096 Views)

Hi Rafi,

 

I thought I must have not fully understood your question.

But I must still confess I still dont understand. which key would this be, the one on the keyboard?

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 6 of 22
(8,095 Views)

Hi Ray,

 

You have a pop up messag with 3 buttons to select.  I would like to know the string content of the label which was selected by the user.

 

for example

   button 1 -  "Ver A.01"

   button 2 -  "Ver A.05"

   button 3 - "Ver C.80"

 

If the user pressed button no.3, then I would like to get the string "Ver C.80".

 

I know how to work around it by using the key no. Pressed, but I prefer to get the string directly, if possible.

 

Thanks

Rafi

0 Kudos
Message 7 of 22
(8,073 Views)

Hi Rafi,

 

Is this what you are looking for.

 

Regards

Ray

Regards
Ray Farmer
Download All
Message 8 of 22
(8,065 Views)

Hi Ray,

 

 YES EXACTLY.

 

Thank you so much.

 

I was not familiar with the function 'evaluate'.  Thanks for introducing it to me.

 

Best Regards

Rafi

0 Kudos
Message 9 of 22
(8,063 Views)

Hi Ray,

 

The result of the step is ""Rel 01""  and not "Rel 01".    

 

Is there a simple way to get rid of the extra quotes?

I can do it, of course, by stripping it out with mid() function but wonder whether there's a simplier way.

 

Thanks

Rafi.

0 Kudos
Message 10 of 22
(8,034 Views)