Write To Measurement File
- Updated2025-01-28
- 8 minute(s) read
Write To Measurement File
Writes data to text-based measurement files (.lvm), binary measurement files (.tdm or .tdms), or Microsoft Excel files (.xlsx).
Use the Read From Measurement File Express VI to read data from the generated measurement file.

Dialog Box Options
Option | Description |
---|---|
Filename | Displays the full path to the file to which you want to write data. The Express VI writes data to the file that this parameter specifies only if the Filename input is unwired. If you wire the Filename input, the VI writes data to the file that this input specifies instead. |
File Format | Contains the following options:
|
Action | Contains the following options:
|
If a file already exists | Contains the following options:
|
Segment Headers | Contains the following options:
|
X Value Columns | Contains the following options:
|
Delimiter | Contains the following options:
|
File Description | Contains the description of the measurement file. LabVIEW appends the text you enter in this text box to the header of the file. This text box is unavailable when you select the Microsoft Excel (.xlsx) option from the File Format section.
|
Inputs/Outputs
![]() Describes error conditions that occur before this node runs. ![]() Appends a comment to each data set written to the measurement file. This input is unavailable when you select the Microsoft Excel (.xlsx) option from the File Format section. ![]() If TRUE, stops writing to the current file, creates the next file in the series, and writes to that file instead. This input is available only when you select the Save to series of files (multiple files) option. ![]() Contains the input signal or signals.
If you wire two or more signals with the same name to the Signals input, LabVIEW appends an integer to the end of the names written in the file, which enforces unique channel names. For example, if you wire two signals named Sine to the Signals input, LabVIEW writes the names as Sine and Sine 1.
Note To change or customize how a signal name displays, use the Set Dynamic Data Attributes Express VI.
![]() Note If you use this Express VI to write data iteratively, setting the Flush? input to TRUE at each iteration might affect the writing performance negatively. National Instruments recommends that you wire a FALSE value to this input until the last iteration of the entire writing process. For the last iteration, you can wire a TRUE value to this input to write all data to the Excel file.
![]() Specifies the name of the file to which you want to write data. If Filename is not wired, the VI uses the Filename specified in the configuration dialog box. ![]() Specifies the DAQmx task to use to populate data on the DAQmx Properties page of the Configure User Defined Properties dialog box. ![]() ![]() Enables or disables the Express VI. The default is ON or TRUE. ![]() Contains error information. This output provides standard error out functionality. ![]() Indicates if the Express VI is saving the data. ![]() Returns the name of the file. |
You can also use the Storage/DataPlugin VIs to read from and write to .tdm files, or you can use the TDM Streaming functions to read from and write to .tdms files.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\File IO\TDMS\Express Read and Write\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\Spreadsheet\Excel\Write Excel File.vi