09-01-2010 11:00 AM
Saludos a todos.
Necesito una pequeña ayuda en un problema que me esta rompiendo la cabeza. Estoy utilizando el event structure para realizar mi programa. Dentro de un case del event structure hago unas operaciones con una estructura while hasta que presione el boton stop para finalizar el bucle while. El problema es que no puedo finalizar el bucle while porqu no reconoce cuando yo pulso este stop.
Si alguien pudiera ayudarme, le estaria muy agradecido
09-01-2010 12:14 PM
09-01-2010 12:18 PM
I cant't stop the bucle while in the "caso 1" with the stop button. What can I do?
09-01-2010 12:37 PM
First, it is a bad idea to set up a while loop inside of an event case. An event case should return quickly from whatever it is doing so that the event structure can be ready to handle the next event. A while loop inside prevents that.
Your main problem is that if you right click on the event case and edit its properties, down to the lower left, you'll see you have a checkbox checked that says Lock front panel until this event completes. You've created a catch 22, the event case can't complete until you stop that inner while loop by way of the stop button, but you can't hit the stop button because the front panel has been locked.
Uncheck that box and you will find things working better.
But in reality, the stop button should have its own event case to handle its button press, and you shouldn't have any code inside an event case like a while loop or user dialog that blocks the execution of the event structure for a long period of time.
09-01-2010 12:53 PM
Thanks man. Now I understand my mistake. I will try changing the program