Using the Write to Measurement File Express VI

Updated Sep 14, 2023

Reported In

Software

  • LabVIEW

Issue Details

What is the Write to Measurement File Express VI and how do I use it?

Solution

The Write to Measurement File Express VI can write data to a text-based measurement file (.lvm), a binary measurement file with headers (.tdm),  a binary measurement file without headers (.tdms), or to a Microsoft Excel file (.xlsx).

This text-based measurement file is a tab-delimited text file that you can open using a spreadsheet or text-editing application. The default delimiter is the tab character but can be configured to use a comma to delimit fields in the text file. The .lvm file also includes header information about the data, such as the date and time the data was generated. LabVIEW saves data with up to six digits of precision in a text-based .lvm file, but higher precision can be achieved when using a .tdm or .tdms binary measurement file. 

Use the File Format option in the configuration dialog box of the Express VI to specify your file type. The options are:
  • Text (LVM) - Sets the file format to a text-based measurement file (.lvm) and the file extension in File Name to .lvm.
  • Binary (TDMS) - Sets the file format to a binary measurement file (.tdms) without an XML header and the file extension in File Name to .tdms
  • Binary with XML Header (TDM) - Sets the file format to a binary measurement file (.tdm) and the file extension in File Name to .tdm.
  • Microsoft Excel (XLSX) - Sets the file format to the Microsoft Excel file type (.xlsx), which is an open XML file format. The file extension in File Name is set to .xlsx.

Use the Action option in the configuration dialog box of the Express VI to configure file saving options. Options include:
  • Saving data to one file or a series of files (parsing your data and saving in multiple files).
  • Prompt the user for a filename once or each time the Express VI executes.

If a file already exists, you can select among the following options:
  • Rename the existing file
  • Append a sequential number to the filename
  • Overwrite the file
  • Append the data to the existing file

If you select the append option, you cannot write new data in a different format, such as if the new data has a different header style or column style. The Express VI writes the new data to the existing file in the original format.

The features mentioned above are shown below in the configuration dialog box for the Express VI. 
 

Additional Information

Refer to the following VIs for examples of using the Write To Measurement File Express VI:

  • TDMS Express Write Data (Time and Frequency Domain) VI: labview\examples\File IO\TDMS\Express Read and Write
  • TDMS Express Write Data (Time Domain) VI: labview\examples\File IO\TDMS\Express Read and Write
  • Write Excel File VI: labview\examples\File IO\Spreadsheet\Excel