LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help writing data to file

Hi all,

I have a project where I am measuring pressure and temperature on an aluminium press tool using National Instruments kit. The code I have is not very complicated at all but I am having some problems.

I need to record all the data during a trial to a single file for processing afterwards but I cannot get it working. When I try and add in a Write to measurement file VI, I always get a buffer error - this is only for one not both (pressure and temperature). I think this is to do with the data sample rate or something but I can't for the life of me figure it out. I also need to do it for both data inputs too.

I think I need a data queuing system? But I'm not sure.

If anyone can advise on why I'm getting the buffer error and/or how to record all the data to an excel/text file that would help me out massively.

I have a feeling there is going to be a pretty simple fix for these problems but I need someone more savvy with LabVIEW to explain it. I have only done one training course on LabVIEW so still learning.

I have attached my VI and a screenshot of the error I get.

Cheers, Greg

Download All
0 Kudos
Message 1 of 4
(1,853 Views)

The standard solution would be to add a 3rd loop with a queue that is a data write loop. The producer queues up data and the 3rd loop writes it. You'll push the problem forward as the writer probably can't keep up, but as long as you have memory for the queue it'll chug along and write until the queue is empty.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(1,821 Views)

Hi Greg,

 


@ghope10 wrote:

I think this is to do with the data sample rate or something but I can't for the life of me figure it out.

You are reading pressure sensors at 20S/s with 2 samples per iteration, this makes your loop spin at 10Hz: usually this is ok for saving data to file without getting buffer overrun errors!

Maybe you are trying to save to a network mapped drive or by creating real Excel files with that other ExpressVI, which you didn't include in your VI: both will slow down the DAQ loop…

 


@ghope10 wrote:

I have a feeling there is going to be a pretty simple fix for these problems but I need …

You need to take more training courses: they are offered for free for the next month!

And you should stay away from ExpressVIs: DAQmx is very easy and explained with lots of example VIs in the example finder!

 

What's the point of using those Relay ExpressVIs to stop plotting data in those charts? A case structure would be much simpler…

Why do you need two charts for two pressure sensors? Both can plot on one chart…

You don't need additional numeric indicators for the pressure values: the charts have their own digital display…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(1,797 Views)

Thanks for the quick replies guys. I'll look into these fixes and get back to you if I have any problems. 👍

0 Kudos
Message 4 of 4
(1,754 Views)