ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Write to Measurment File VI number of samples row header

Solved!
Go to solution

Hey all

 

I'm writing data to a .CSV file via the "Write to Measurement File" express VI that takes in an array of Waveforms from a DAQmx read function.  Currently, I am appending to the file every few samples instead of writing all at once when the measurement is done being taken to prevent total data loss if the program unexpectedly terminates as well as to make sure the shift register that's holding this data doesn't fill up.

 

This is all working great, except that as part of the header that's generated, a number of samples is given for each signal that it's writing from.  When the data is written via appending; however, that number of samples is set to however many samples are taken per append rather than all the samples in total.  The issue with this is that when I go to read that data (using the "Read from Measurement File" express VI), it will only read as many samples as the sample header indicates, meaning it's not reading the entire data file.

 

I was wondering if there was any way to change this without having to manually or prgrammically edit the sample row in the header to be accurate to the number of actual samples, or if there were a way to read this measure file fully regardless of what the sample row says.

 

(Personally, I'd rather use the "Export Waveforms to Spreadsheet File" VI, but the time column for that VI uses actual time stamps rather than a delta T number, which I'm not a fan of.)

 

Any help would be much appreciated

0 Kudos
Message 1 of 3
(1,111 Views)
Solution
Accepted by topic author nichkane

Hi nichkane,

 


@nichkane wrote:

I'm writing data to a .CSV file via the "Write to Measurement File" express VI that takes in an array of Waveforms from a DAQmx read function


Why don't you use the TDMS-saving feature already built into DAQmx? Just configure the task to also save to a file!

Then you can easily read the TDMS later on and even do your conversion to CSV, if really needed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(1,104 Views)

Hi,

Seems I learn something new every day.  I'll look into this feature.  Thank you!

0 Kudos
Message 3 of 3
(1,097 Views)