Convert CSV File to TDMS With NI Software

Updated Apr 1, 2024

Reported In

Software

  • LabVIEW
  • DIAdem

Issue Details

I am using CSV files to gather information about test results and I need to convert them to TDMS files to be analyzed. What is the best approach to convert the files from CSV to TDMS format?

Solution

You can use DIAdem to load the CSV files into the Data Portal since any data loaded is inherently mapped onto the TDMS model. To load or read a specific format for example a custom CSV file you need to develop a DataPlugin. This can be done with the Text DataPlugin Wizard in DIAdem, for more complex formats a script is needed. IN order to determine if the specific file format that you are trying to load can be configured with the DataPluging Wizard take a look at the DIAdem DataPlugin Text and Excel Wizard Requirements.

If the file format complies with the Wizard requirements then you can use the following articles which fo through the steps on how to create the DataPlugin:
If the custom file has a more complex structure you need to create a DataPlugin using a script. The following document has additional resources and examples on how to do it: Resources for Writing Your Own DataPlugin.
 

     
     

    Additional Information

    Once you have developed a dataplugin that can read the custom file format, you can automate the process by creating a DIAdem script. The following article goes through the steps on how to automate exporting the files using the DataFileSave() function and the recording mode to create the script: Use DIAdem to Save Files in File Formats Other Than TDM and TDMS.

    On page 85 of the DIAdem Hands-On Exercises (diadem_version_2020_hoe.pdf) there is an example of how to configure the DataPlugin Wizard to read a custom text file format.