LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Two button Instead of one stop button in while loop?

Hello,

I want to use 2 buttons Pass and Fail instead of stop button.

Means here in attachment I have made one  sample program which is similar to my actual program.

In that case there is one continuous run time function(device) is arrange in while loop and we have to check the functionality of that device,when user thing that this device is working good then he will press pass button so message in log window will display that device is pass and process will stop.

And suppose this device is not OK then user will press Fail button so message will display that device is not OK.

Hope you will get me..

In attachment I want to use Pass and Fail button instead of stop button so user can press any button and stop the process.

 

Thank you very much in advance.

0 Kudos
Message 1 of 10
(3,169 Views)

User Event Structure.....right tool for the right job. Handle either button press with separate event cases.

0 Kudos
Message 2 of 10
(3,164 Views)

Thank you BillMe,

Can you please send me any example vi regarding to this ,

becase I am not sure how to arrange this event structure in this case ,  my whole programme is in Event structure and this testing is part of my Main programm.

Thank you very much for replying.

 

 

0 Kudos
Message 3 of 10
(3,155 Views)

If your code is already in event structure then you can add the Value change events for both the Ok and Not Ok buttons in the same event case and check one of the value and give the output. Main thing is set the Button's mechanincal action to Latch when Released.

 

Event-2Button-1.png

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 10
(3,150 Views)

Thank you very much for reply,

 

Here in attachment I have put my sample vi with case structure,will you please guide me that what kind of change I need to do in that?

I tried with given solution but may be I missed some concept so I am not able to get solve the problem.

 

Thank you very much for understanding.

0 Kudos
Message 5 of 10
(3,141 Views)

You are currently missing a couple of concepts :D. If you made the current code, you seem to know how to configure events, so simply create another event for the fail button. I actually could not find a fail button in your code. Where is it?

 

In addition, you might want to give all controls a label, especially the ones used for events. A ["": value change] event make the code hard to read and debug. Why are there 2s waits in the dialog cases? The code won't continue until the dialog is acknowledged, the wait just throws more sand into the gears. 😉

 

I would also strongly recommend to keep user iteractions handling to the upper loop. For example, the pause handling is just weird. Also the "maths" state has a CPU burner loop ...

0 Kudos
Message 6 of 10
(3,124 Views)

I tried to implement Event structure with pass and no pass event but still I am confuce will you please guide me that what should i have to do in order to user choice message.means pass or fail.

here in attachment I have attached that vi.

Thank you for help.

0 Kudos
Message 7 of 10
(3,109 Views)

Have a Look

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
Message 8 of 10
(3,083 Views)

Thank you Himanshu for reply,

 

I think my structure is may be different, in your case its OK but how can I get same function in attached Vi.??

Please guide me..

I am confused at the math function loop what kind of logic should I use to get appropriate solution??

Thank you very much in advance.

0 Kudos
Message 9 of 10
(3,074 Views)

its solved now...

thank you vary much to every one who has spending their time ,.....

0 Kudos
Message 10 of 10
(3,052 Views)