LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing an 1D array of Waveform to measurement file

Hi,

I am trying to write data to a measurement file which is in the format of a 1D array waveform. The problem is because i am writing to the file inside the loop, when the sampling rate is increased to a hogh rate e.g 1000Hz and the number of samples is e.g. 1000 then the displayed becomes very slow and take much more time to complete. This is because the program is having to open and close the file at each loop iteration.

Can someone please help me out as i am fairly new to labview.  The device i am using is a NI 9215 BNC module connected to a Compact DAQ chassis. I have attached my VI

All help will be appreciated.

Regards
Harshil
0 Kudos
Message 1 of 4
(2,998 Views)
Which version of LV are you using? If you are using LV 8.20, I recommend using TDMS (TDM streaming) files instead of TDM files. Write to measurement file actually writes to a measurement file. TDMS in the correct data format for streaming data to disk. Another option is to use Storage VIs that you can find under File I/O / Storage palette. This set of VIs also write to TDM file like Write to Measurement File but allows more flexibility.

Depending on the complexity of your application you may also want to use HDF5 file format that is excellent for more complicated applications if you meet the limits of TDM or TDMS. Ask me about HDF5 if this is the case.

Tomi
--
Tomi Maila
0 Kudos
Message 2 of 4
(2,984 Views)
Hi,

Thanks for the help. I am using LV 8.0 . I have tried to use arrays to store the dats before i  output. The problem is when it writes at the end, the format changes and i do not get the channel name and the dt value (time interval between samples).

Also if i select more than two channels than i do not get two colums in the output file but one column with both the values of the channels.

Please help on how to get round this.

Harshil
0 Kudos
Message 3 of 4
(2,980 Views)


Hi Harshil

I have been looking into your problem and am slightly puzzled as to why you only wish to read one sample in a second? Is this so that you get a constantly updating plot on the front panel? If you were to sample at say 100 samples a second, you would find your program will run much quicker. If you ran at 1000 samples a second, you could remove the while loop alltogether from your program. By increasing the number of samples per second, you will notice a dramatic improvement in your graph update rate, whilst cecreasing the overhead caused by opening and closing the Write Signal function.

If however your investigation requires you to read in at 1 sample per second, you can do a constantly streaming TDMS file, as previously mentioned in the other post. This method means that the file is not constantly opened and closed during the loop iterations. However, saving your data in this format prevents it from being opened easily in other programs such as Excel.

I hope this information is of use to you.

Best regards

Rob


Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 4 of 4
(2,962 Views)