12-18-2018 02:16 PM
Hello,
Problem:
I am trying to export Labview data as an LVM file which is going fairly smoothly. However, my while loop runs extremely quickly, about 100 Hz. That is causing my data in the excel files difficult to collect and present due to the rapid collection rate.
However, this rate is nice for the graphs on my front panel, showing smooth and steady visual readings. I need to find a way to write this data to the LVM file at a slower rate, perhaps once every 1-2 seconds, while still maintaining the frequency of the Labview data collection.
I apologize for poor wording, I am very new to Labview as I am an intern.
Ideas:
Should I put a certain timing restriction on my loop? I tried setting the 'wait until next' to 1000, which sort of worked, but for some reason I wasn't getting any temperature measurements from the thermocouple.
Maybe there are advanced ways of tweaking the write to measurement file to set it to every nth iteration? Maybe every 100th?
I'm quite lost here, as there may be a multitude of problems or poor structuring in my VI. Here are some pictures for reference.
Anyway, thanks for reading!
12-18-2018 02:28 PM
You need to look at a producer/consumer setup. Basically, this would allow you to offload the file operations to another CPU process that's running in parallel with your DAQ loop. This can be accomplished using several different methods. Queues are probably the most frequently used method. Newer versions of LabVIEW employ channels to accomplish this. Check out the design templates when you click File -> New... (notice the 3 dots) and you should see one called Producer/Consumer Design Pattern (Data). This will help you get started.
12-18-2018 02:31 PM
Awesome, will do.
Thank you!
12-18-2018 02:31 PM
I would put the file logging in its own loop. Use some communication mechanism to share data with the second loop, and have that loop run at its own rate. Because your logging loop only really cares about the latest data, I would probably use something like a DVR to pass data between them.