Write To Measurement File
- Updated2025-07-30
- 8 minute(s) read
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
error in (no error)
—
Describes error conditions that occur before this node runs.
Comment
—
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.
new_file
—
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.
Signals
—
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.
Flush? (T)
—
Specifies whether LabVIEW writes data to the Microsoft Excel file each time after this Express VI runs. If the value is FALSE, LabVIEW does not write the data to the Microsoft Excel file. Instead, LabVIEW stores the data in a temporary file. If the value is TRUE, LabVIEW writes the data from the temporary file to the Excel file and then purges the temporary file. The default is TRUE.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.
Filename
—
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.
DAQmx Task
—
Specifies the DAQmx task to use to populate data on the DAQmx Properties page of the Configure User Defined Properties dialog box.
Reset
—
Specifies whether you want to reset the data file when you run this Express VI iteratively. LabVIEW ignores this input when you run this Express VI in the first iteration. During the second and subsequent iterations, if the value is FALSE, this Express VI appends data to a file if the file already exists. Depending on your configuration for this Express VI, if the value is TRUE, this Express VI renames, overwrites, or skips a file if the file already exists. The default is FALSE.
Enable
—
Enables or disables the Express VI. The default is ON or TRUE.
error out
—
Contains error information. This output provides standard error out functionality.
Saving Data
—
Indicates if the Express VI is saving the data.
Filename Out
—
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
error in (no error)
—
Comment
—
new_file
—
Signals
—
Filename
—
DAQmx Task
—
error out
—
Saving Data
—
Filename Out
—