How to Convert TDMS File into UFF58 File Using LabVIEW

Updated May 8, 2024

Environment

Other

LabVIEW Sound and Vibration Toolkit

Sometimes when using specific software, the data generated or acquired will be saved in their default format type such as TDMS file format. However, the user might need to access the saved file in other file format, such as UFF58. LabVIEW provides functions that can convert different file formats into UFF58.

This article is only focusing on how to convert TDMS file into UFF58.
Before you start, make sure LabVIEW Sound and Vibration Toolkit is installed in your LabVIEW application.

  1. Open your LabVIEW application.

  2. Place TDMS Open, TDMS Read and TDMS Close on LabVIEW block diagram. Note: It is always a best practice to close the file to prevent from running out of file handles and/or memory crash or memory no space issue.
    image_2022-06-09_143249005.png

  3. Wire the tdms file and error of TDMS Open, TDMS Read and TDMS Close in sequence. Also, add the control on the file path of TDMS Open and wire Simple Error Handlervi to the error out of TDMS Close for better error handling.
    image_2022-06-09_162313199.png

  4. (Optional) On TDMS Openvi, right click and create a constant to set the operation (0:open) to open.

  5. (Optional) On TDMS Readvi, right click and create constant for group name in and channel(s) name in. Provide the correct group name in and channel(s) name in.

  6. Place SVT UFF58 Open Filevi, SVT UFF58 Writevi and SVT UFF58 Close Filevi on the same block diagram. 
    image.png

  7. Wire the file refnum and error of SVT UFF58 Open Filevi, SVT UFF58 Writevi and SVT UFF58 Close Filevi in sequence and parallel to the sequence of TDMS functions that have been created on steps 2 to 5.
    image.png

  8. (Optional) On SVT UFF58 Open Filevi, right click and create constant for open mode(create:0). Select create or replace. Note: If you select create only, when you run the VI for the second time while the file path is the same, you may get Error 10. Make sure to select different file path to avoid Error 10 when using create open mode on SVT UFF58 Open File.vi.

  9. Change the SVT UFF58 Writevi polymorphic VI selector to suit the data type from the TDMS file. In this example, TDMS file contains 1D array of waveform data, thus the polymorphic VI selector selected is Time Waveform >> N channels.

  10. Wire the data from TDMS Read into the waveform of SVT UFF58 Writevi. Remember to merge the error out of TDMS Close and SVT Close Filevi to Simple Error Handlervi.
    image.png

  11. Save the VI. If you follow best practices of writing a good code, your VI should look like below. Note: You could use control or relative path constant to navigate to the file path. Avoid using absolute file path constant to eliminate the possibility of getting file path error when the code is used on different file directories.
    image.png

  12. Run the VI and the UFF58 file will be generated on the UFF58 file path selected/provided.

After running the VI, you should be able to see a new UFF file in the directory path that you have selected. Example:
image.png


Notes:
The above example could be used to write TDMS file into other file format just by replacing the SVT Open File
vi, SVT Writevi and SVT Close Filevi.