LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

three loops in the same VI

Solved!
Go to solution

Hi,

I Have three loops that turn in the same VI. The first loop acquire data from the using fifo fonctions Controler (we call it a producer loop), and the second one receive data from the producer loop and save it in a TDMS's file. while the last one acquire data loged in the TDMS's file and display it on the graphe

My data are saved on the TDMS's file, but its not showed on the grahe.

I was wondering if the data aren't displayed cause the Labview cannot turn three loops on the same time or cause I made a mistake in the third loop.

Thank you in advance for answer

 

My Best Regards

 

Ps: Please find attached the VI

0 Kudos
Message 1 of 4
(2,612 Views)

You're reading and writing the same file simultaneously, which is probably the reason. You also run the risk of losing data since you try to synch the top 2 loops with a Wait. I'd simply put it all in the same loop, Data gathering, TDMS write and graph update. With a 200ms loop time it shouldn't be any problems.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 4
(2,599 Views)

As far as I know, there is no limit on the number of loops that can run simultaneously.

 

If there is a limit, it is very high (maybe in the hundreds) --- much higher than any well-written program would require.

 

Yameada is right: the best solution is to stream-line the programming so that all activities are done in one loop. Graph and save the data when it is produced. There is no need to save it and then read it back to graph it.

Message 3 of 4
(2,577 Views)
Solution
Accepted by topic author k.nadia

First of all, use an actual queue for passing data from your producer to your consumer.  There is no need to put the waits in your consumer.  The dequeue will limit the rate of the loop.

 

Secondly, put the graph in your producer loop.  It will save you so much headarches.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(2,550 Views)