LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop inside event structure

Hi,

 

 

I am using a simple while loop in an event structure.

 

 

The problem is that i am not able to stop the while loop by stop button.

 

 

0 Kudos
Message 1 of 7
(3,898 Views)

Because you have the properties for the OK button value change event set to lock the front panel until the event completes.

 

I suggest you search the forums for message threads dealing with while loops and event structures.  I'm sure you'll find your question would have been answered hundreds of times before.

 

Your code is inside out.  In general, don't put a while loop or any code that takes a long time to execute inside an event case.  The event structure itself should be inside a while loop.

Message 2 of 7
(3,894 Views)

Ravens Fan a écrit: 

I suggest you search the forums for message threads dealing with while loops and event structures.  I'm sure you'll find your question would have been answered hundreds of times before.


 

I also strongly recommend to read the Caveats and Recommendations when Using Events in LabVIEW.

 

0 Kudos
Message 3 of 7
(3,861 Views)

Hello,

 

I have read you question perfectly & solve it. but I can not excess your due to your higher version of LabVIEW than me. So I attached here my logic to you. To event structure simply enter the any timeout value then you will able to stop the while loop by stop button. I hope you get your desire answer.

 

Thank you 

Vinal Gandhi, CLA
0 Kudos
Message 4 of 7
(3,857 Views)

Vinal G wrote:

So I attached here my logic to you.


That code makes absolutely no sense.

0 Kudos
Message 5 of 7
(3,841 Views)

Hi shrekt,

  Just you need to uncheck the option  "Lock front panel untill the event completes" (this option will beat the bottom of edit events)  andthe code will work fine.But always dont try to put while inside a event structure(good programmng practice).

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 6 of 7
(3,825 Views)

Hi guys,

 

 

Thanks for replying,

 

I got the logic changeto avoid any other problem.

 

 

Thanks

 

 

Regards,

 

Shrek

0 Kudos
Message 7 of 7
(3,817 Views)