From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detener bucle while en cualquier instante de tiempo

Solved!
Go to solution

Hola a todos. Tengo una pequeña inquietud sobre un programa que estoy realizando, a ver si me pueden ayudar. El programa realiza la adquisicion de datos de un datalogger via serial, la cuestion es que quiero mostrar los datos de temp y humedad cada minuto y para eso uitilizo un delay. El problema surge cuando quiero detener la ejecucion y presiono el boton de Stop para detener el ciclo while, este espera hasta que termine el tiempo de retardo y despues de esto para la ejecucion del programa. Mi pregunta es si existe alguna manera de que en cualquier instante de la ejecucion atienda la peticion de Stop que realizo. O si en su defecto puedo atender a una accion de cualquier boton en cualquier instante de tiempo sin tener que esperar a que termine el bucle.

Gracias

0 Kudos
Message 1 of 11
(8,073 Views)

Google Translate:

 

Hello everyone. I have one small concern about a program I'm doing and see if I can help. The program performs a data acquisition via serial datalogger, the question is I want to show the temp and humidity data every minute and for that uitilizo a delay. The problem comes when I stop running and I press the Stop button to stop the while loop, it waits until the end of the delay time and after that for the execution of the program. My question is whether there is any way that at any moment of execution Stop replied to the request that I do. Or failing that I can attend any one action button at any instant of time without having to wait to finish the loop.

 

 

To answer the question: you need to set your loop to a small delay and check to see if it's time to perform an acquisition. See example.

0 Kudos
Message 2 of 11
(8,064 Views)

¿Se puede conectar el programa o una imagen del diagrama? En "png" por favor, no "bmp" formato.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 11
(8,061 Views)

Gracias smercurio_fc pero eso no es lo que busco porque no puedo detener el bucle while hasta que termine el tiempo de retraso.

Aqui subo el programa que estoy haciendo. Quiero que al presionr el boton de Stop en cualquier instante de tiempo, pare el bucle while. Estoy buscando esa forma porque si lo hago con el boton de parar la corrida de la barra de herramientas no me cierra el puerto

0 Kudos
Message 4 of 11
(8,052 Views)

Google Translate:

 

Thanks smercurio_fc but that's not what I want because I can not stop the while loop until the end of the delay time.

Here I upload the program I'm doing. I want to presionr the Stop button at any instant of time, stop the loop. I'm looking that way because if I do it with the button to stop the run on the toolbar I do not close the port

 

 

Did you try running my VI? It stops instantly.

 

¿Ha intentado ejecutar mi VI? Se detiene al instante.

0 Kudos
Message 5 of 11
(8,046 Views)

Yes I ran your program but when I increase the delay time It doesn't stop inmediatly

0 Kudos
Message 6 of 11
(8,042 Views)

Do not change the delay time. Leave that alone. Change the Elapsed Time Express VI to set the time.

 

No cambie el tiempo de retardo. Deja esto. Cambiar el tiempo transcurrido Express VI para establecer la hora.

0 Kudos
Message 7 of 11
(8,038 Views)

You're right. It works. I'm gonna try that in mi program because the user has to put the time. Thanks

0 Kudos
Message 8 of 11
(8,031 Views)

Well it works, but now the problem is when I run the program it takes the delay time until do anything.

0 Kudos
Message 9 of 11
(8,026 Views)
Solution
Accepted by topic author georgexam

That's a simple fix.

0 Kudos
Message 10 of 11
(8,020 Views)