04-07-2025 03:29 PM
My lab view program is recording many more data points that it is displaying on a graph much quicker than it is recording data points for excel. How do I fix this? Here is a video of the vi running, Program Running, and a copy of the excel output. As you can see the excel graph has much less detail than the LabVIEW graph as it iterates.
04-07-2025 04:47 PM
When you are recording, everything takes place in a single loop, the Data Acquisition, all of the data processing, and the data saving.
One "fact" that is difficult to tell from your code is what sampling rate you are using, and how many samples you take at a time. Fortunately for you, you are not writing an Excel file, but are writing a Delimited Spreadsheet which gets the default extension .csv (for Comma-Separated Values) that Microsoft "blesses" with an Excel-looking icon.
One good way to slow down your loops is to handle data a lot. To speed things up, separate tasks (data acquisition in one loop, data processing and storage in another loop, handling data "chunks" at a time (i.e. don't process single points, process arrays of points). Learn about the Producer/Consumer design pattern.
Bob Schor
04-08-2025 09:50 AM
Make sure you Open a file ref and create the DaqMX tasks outside the loop and close them afterwards. Inside the loop should only be the Read sample (and it's probably fine with the write to file assuming you're using the 1kHz and 1000 samples that's default in the code)