12-13-2016 11:05 AM - edited 12-13-2016 11:09 AM
Hello everybody,
I'm doing some stuff relate to write the data to file. At first, I use the Write to measurement file VI, placed it inside the while loop but I realized it slow down the acquisition speed. Then I tried the enqueue dequeue followed by Labview's example.
When I test with enqueue speed and dequeue speed same are 100ms. It worked fine, not slow down the acquisition speed at all.
Then, I changed the enqueue speed and dequeue speed same into 5ms. The result wasn't like what I expect. The elements in Queue increase quite rapidly and the data in 2nd loop (dequeue) is slower. (if I dont use the write to measurement file VI, 5ms is still ok)
So, is there any way to remain the acquisition speed or was I wrong somewhere?
Please help me to get rid of this stuff. This is very urgent
Thank all of you.
Solved! Go to Solution.
12-13-2016 11:34 AM - edited 12-13-2016 11:56 AM
Express vis are quite powerful and often help new users write working code quickly. BUT, they come at a cost! because they do so many things they make a lot of choices along the way. They are not optomized for performance they are optomized for developers who are not experts.
How have you configured the Write to Measurements Express vi? What file format? There are functions on the "File I/O palette" that will do the same thing faster and with less overhead.
With that said, WHY do you even have a "Wait" in the data logging loop? You don't need it! that loop is paced by the Dequeue Element function since it cannot run faster than when the data becomes available. AND YOU WANT to dequeue data as fast as it is available! if something happens to build up a queue lag, let that loop go and demand all the CPU it needs until the queue gets emptied. Better yet, try
If you really can't get away from those express vis. (Ninja move)
Whatever you do, GET THAT Filepath terminal outside the loop! (what happens if its empty?) What happens if you change the value? Reading that terminal inside the loop forces a lot more choices on the Express vi
12-13-2016 10:15 PM
Thanks for your advice.
I've tried to use the TDMS streaming in File I/O combine with enqueue dequeue structure and It worked like a charm.