LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rewrite the tdms file keeping some of the data values.

Hi, 

 

I am writing a code in which data values  saved in the TDMS file in two ways. 1. From DAQ  2. Manual input. Both of this inputs should be in parallel.

 

Whenever I give manual input, it should overwrite the previous values and to be saved in the previous location. Whereas data from the DAQ should not be  altered. 

 

These are the difficulties I am facing in this code

1. If I use, TDMS open (existing)  to write the data, It will adds the data to the previous data. Whereas I nead it to overwrite existing.

2. If I use create and replace option, I loose the data from the DAQ.

 

Please suggest me better way to do this function. 

 

Thank you 

Shrinivas 

0 Kudos
Message 1 of 4
(3,557 Views)

My colleague who is learning LabVIEW asked me about this yesterday. Here are the options I gave to her in order of my preference:

 

1) I would personally not want to modify an existing file with raw data in - I would just log the raw/DAQ data into its own TDMS file and if you are producing any additional files with manually input data then combine the DAQ data and the processed data into a new TDMS file.

 

2) If you definitely want to update the existing file, you'll need to read out the raw data channel from the file, write that data to a new file with your modified data. You can then close the original file and rename it to overwrite the original, if you want.

 

I told her that TDMS files are really supposed to be for your raw measurement data so I couldn't really see why you would modify that data (it's like fudging your results in science!) - for presentation/reporting I would take that raw data and put it into a new file.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 4
(3,538 Views)

Hi Shrinivas,

 

If the raw data is not DAQmx raw data, TDMS Set Next Write Position Function is provided to overwrite the existing data in a .tdms file. The function is located at Advanced TDMS Pallette. But TDMS component does not support overwriting DAQmx raw data.

 

Jie Zheng | TDMS | LabVIEW R&D

0 Kudos
Message 3 of 4
(3,491 Views)

You can delete data in a TDMS file using the function File IO > TDMS Streaming > Advanced TDMS > TDMS Delete Data.

You must to provide the absolute path (including the .tdms extension), group name, and channel(s) name(s) you want to delete.

NI Distributor Ecuador
CLD + CPI
0 Kudos
Message 4 of 4
(3,125 Views)