05-31-2012 09:50 AM
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
06-01-2012 05:39 PM
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
06-04-2012 08:47 AM
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.
06-05-2012 08:50 AM
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.