LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two vis different timings?

I'm creating a VI that must have two different cycles of execution.
That is one that get's data from a source during a cycle of 10 seconds
and another that updates the gui all the time (10ms) how can i update
the gui and still have the other one running independently?
thank you
0 Kudos
Message 1 of 5
(2,828 Views)
Use two case structures in the same loop running at least as fast as your fastest task (updating the GUI). The cases are controlled by checking the time.
See additional comments and my example posted here.
0 Kudos
Message 2 of 5
(2,828 Views)
I'm not sure that I completely understand what you're trying to do. Are your trying to obtain data over a 10 second period in 10 ms intervals and update the gui at each 10 ms reading? If so, then you need a single case structure inside a while loop whose conditional end is when the time is 10 seconds past the original time. The condition for the case structure is that 10 milliseconds have passed since the last time it ran. The case structure would have the code to obtain the data and update the gui.

If you are trying to take data every 10 seconds then you may be able to get by with using two separate loops running in parallel with Wait timers. While the timing of this method is not as precise as in the method that Al S gave, it is likely adequate for such l
ong intervals, especially if the execution time of the code is not too long, and requires less programming. As long as you have adequate wait timers in your loops or subvis there should be no problems with parallel processing.
0 Kudos
Message 3 of 5
(2,828 Views)
Just use two separate loops on your VI's diagram, one for the data I/O and one for the GUI. Use queues, notifiers or local/global variables to send data from one loop to the other.
0 Kudos
Message 4 of 5
(2,828 Views)
Thanks for the tip it worked out fine!! I used the first solution proposed by AI S
0 Kudos
Message 5 of 5
(2,828 Views)