From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Measurement File Express Vi and Timestamps with TDMS files.

I am able to log data to an lvm file with a timestamp "One column only" with "One header only" using the Write to Measurement File Express VI.  I can see the timestamp column with the logged data when I open the lvm file using Notepad.

 

However, when I take the exact same code and change the Write to Measurement File Express VI to log to a TDMS file format (the only change); I receive an error that the data type is different and the file cannot be amended. I am not amending files. I have selected the option to "Use the next available file name". I have tried deleting the Write to Measurement File Express VI and replacing it, I have tried to rename the file name, and I have tried to save to a different location. The error appears after all attempts.

 

This error also occurs when select the X Value Column option "One Column Only".  The only time the error disappears is when the option "Empty time column" is selected.

 

Does the TDMS file format not allow timestamps? I need to use the TDMS file format because it is the best for streaming data to disk, which is what the project requires. We are logging data at 1kHz. I have been using the lvm format for testing only and I have been pleased with the output file provided.  It is preferred to use the actual timestamp's data and not back calculate the time using the header files to and dt values for each data point.

 

I see this example on NI's website:

 

TDMS Direct Integration in NI-DAQmx Logging

 

Would this example provide the timestamp in the TDMS file? If not is there an example that I can use that will provide the timestamp with each datapoint?

 

I plan to use this VI to convert the TDMS file to text:

Convert very large TDMS to ASCII (txt)

 

Using:

Windows 7

LabVIEW 2010 SP1

 

 

 

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

Hi MgDAQ,

 

The example at the link below will write to a TDMS file with a timestamp.

https://decibel.ni.com/content/docs/DOC-11313

 

Can you try running the Express VI with the settings you mentioned in that example program?


@MgDAQ wrote:

I am able to log data to an lvm file with a timestamp "One column only" with "One header only" using the Write to Measurement File Express VI.  I can see the timestamp column with the logged data when I open the lvm file using Notepad.

 

However, when I take the exact same code and change the Write to Measurement File Express VI to log to a TDMS file format (the only change); I receive an error that the data type is different and the file cannot be amended. I am not amending files. I have selected the option to "Use the next available file name". I have tried deleting the Write to Measurement File Express VI and replacing it, I have tried to rename the file name, and I have tried to save to a different location. The error appears after all attempts.

 

This error also occurs when select the X Value Column option "One Column Only".  The only time the error disappears is when the option "Empty time column" is selected.

 

Does the TDMS file format not allow timestamps? I need to use the TDMS file format because it is the best for streaming data to disk, which is what the project requires. We are logging data at 1kHz. I have been using the lvm format for testing only and I have been pleased with the output file provided.  It is preferred to use the actual timestamp's data and not back calculate the time using the header files to and dt values for each data point.

 

I see this example on NI's website:

 

TDMS Direct Integration in NI-DAQmx Logging

 

Would this example provide the timestamp in the TDMS file? If not is there an example that I can use that will provide the timestamp with each datapoint?

 

I plan to use this VI to convert the TDMS file to text:

Convert very large TDMS to ASCII (txt)

 

Using:

Windows 7

LabVIEW 2010 SP1

 

 

 



@MgDAQ wrote:

I am able to log data to an lvm file with a timestamp "One column only" with "One header only" using the Write to Measurement File Express VI.  I can see the timestamp column with the logged data when I open the lvm file using Notepad.

 

However, when I take the exact same code and change the Write to Measurement File Express VI to log to a TDMS file format (the only change); I receive an error that the data type is different and the file cannot be amended. I am not amending files. I have selected the option to "Use the next available file name". I have tried deleting the Write to Measurement File Express VI and replacing it, I have tried to rename the file name, and I have tried to save to a different location. The error appears after all attempts.

 

This error also occurs when select the X Value Column option "One Column Only".  The only time the error disappears is when the option "Empty time column" is selected.

 

Does the TDMS file format not allow timestamps? I need to use the TDMS file format because it is the best for streaming data to disk, which is what the project requires. We are logging data at 1kHz. I have been using the lvm format for testing only and I have been pleased with the output file provided.  It is preferred to use the actual timestamp's data and not back calculate the time using the header files to and dt values for each data point.

 

I see this example on NI's website:

 

TDMS Direct Integration in NI-DAQmx Logging

 

Would this example provide the timestamp in the TDMS file? If not is there an example that I can use that will provide the timestamp with each datapoint?

 

I plan to use this VI to convert the TDMS file to text:

Convert very large TDMS to ASCII (txt)

 

Using:

Windows 7

LabVIEW 2010 SP1

 

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 2 of 4
(3,660 Views)

Thank you for the example Zach. I will give the example code a try.

 

To answer your question: 

 

Can you try running the Express VI with the settings you mentioned in that example program?

 

After a quick review of the example code I have already ran the Express VI using the settings mentioned in the example program based the attempts documented on my original post. However, perhaps the Express VI's underlying code is different from the example program. I will try the example program, thank you for the suggestion.

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

The example program: Write Data (Events) to a TDMS File logs time for the event only, and not for the measured data. Also, the time is actual and not relative to the experiment. Regardless - the example was helpful.

 

After further investigation I found I am able to see a timestamp (relative) next to the data point in Excel even though the option "Empty time column" is selected - as this was the only option I could get the Express VI in my program to run without an error for the TDMS file format. I would not have guessed LabVIEW installed an add-on to Excel to allow for TDMS file viewing, which is why I used conversion vi's to view it.

 

If I use the vi: Convert very large TDMS to ASCII (txt)  for the tdms file the timestamp disappears.  How odd.

 

Thank you again for the example program.

 

 

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