Read From Measurement File Express VI

Owning Palette: Input Express VIs

Requires: Base Development System

Reads data from a text-based measurement file (.lvm) or binary measurement file (.tdm or .tdms).

Details  Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Add to the block diagram  Find on the palette

Dialog Box Options

ParameterDescription
FilenameDisplays the full path to the file from which you want to read data. The Express VI reads data from the file that this parameter specifies only if the Filename input is unwired. If you wire the Filename input, the VI reads data from the file that this input specifies instead.
File FormatContains the following options:
  • Text (LVM)—Sets the file format to text-based measurement file (.lvm) and the file extension in File Name to .lvm.

    To enable this VI to read data from generic text files, place a checkmark in the Read generic text files checkbox.
  • Binary (TDMS)—Sets the file format to binary measurement file (.tdms) and the file extension in File Name to .tdms. If you select this option, the Time Stamps and Generic Text File sections are not available.
  • Binary with XML Header (TDM)(Windows) Sets the file format to binary measurement file (.tdm) and the file extension in File Name to .tdm. If you select this option, the Time Stamps and Generic Text File sections are not available.

    When you select this file format, you enable the Lock file for faster access checkbox. Selecting this checkbox makes reading and writing significantly faster (at the expense of the ability to multitask certain activities). It is recommended that you use this option in most cases.
    Note  When this option is enabled, no two Express VIs can access the same file at the same time when one of them is writing a "series of files."
ActionContains the following option:
  • Ask user to choose file—Displays a dialog box that prompts users to select a file.
Segment SizeContains the following options:
  • Retrieve segments of original size—Retrieves segments of the signal from the file in the original size.
  • Retrieve segments of specified size—Retrieves segments of the signal using the size you specify in Samples.
    • Samples—Specifies the number of samples you want to include in the segment size read from the file. The default is 100. This option is available only when you select the Retrieve segments of specified size option.
Time StampsContains the following options:
  • Relative to start of measurement—Displays the timestamp in terms of seconds starting from zero. For example, 100 in relative time equals 1 minute and 40 seconds.
  • Absolute (date and time)—Displays the timestamp in terms of time elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00].
    Note  These options are available only when you select the Text (LVM) option from the File Format section.
Generic Text FileContains the following options:
  • Start row of numeric data—Indicates the first row of numeric data. The Express VI begins reading data from this row. The default is 1.
  • First row is channel names—Specifies that the channel names are in the first row of the data file.
  • First column is time channel—Specifies that the time data for each channel are in the first column of the data file.
  • Read File Now—Imports the data from the file you specify in File Name into the Sample data table.
  • Sample data—Displays the data from the file you specify in File Name when you click the Read File Now button.
    Note  These options are available only when you select the Text (LVM) option from the File Format section.
DelimiterContains the following options:
  • Tab—Uses tabs to delimit fields in the text file.
  • Comma—Uses commas to delimit fields in the text file.
    Note  These options are available only when you select the Text (LVM) option from the File Format section.
Decimal PointContains the following options:
  • . (dot)—Uses a period as the decimal separator.
  • , (comma)—Uses a comma as the decimal separator.
    Note  These options are available only when you select the Text (LVM) option from the File Format section.
Text (LVM)Sets the file format to text-based measurement file (.lvm) and the file extension in File Name to .lvm.

To enable this VI to read data from generic text files, place a checkmark in the Read generic text files checkbox.

Block Diagram Inputs

ParameterDescription
EnableEnables or disables the Express VI. The default is ON or TRUE.
FilenameSpecifies the name of the file from which you want to read data.
ResetResets the file position such that the next read starts at the beginning of the file.
error inDescribes error conditions that occur before this node runs.

Block Diagram Outputs

ParameterDescription
DescriptionReturns the description in the header of the .lvm or .tdm file.
CommentReturns the appended comment of each data set in the .lvm or .tdm file.
SignalsContains the output signal or signals.
Filename OutReturns the name of the file.
error outContains error information. This output provides standard error out functionality.
EOF?Returns TRUE when the Express VI reaches the end of the file.

Read From Measurement File Details

You also can use this VI to read Multisim data if you have Multisim 9.0 or later installed. Use the Write To Measurement File Express VI to write data to a measurement file. You also can use the Storage/DataPlugin VIs to read from and write to .tdm files.

Note  The behavior of this VI changes depending upon the target. If the current target does not or might not have a host computer connected, the configuration dialog box displays warnings next to options that are invalid without a host. If you configure this VI to prompt for input and run the VI on a target with no user interface, such as the Real-Time Module with no host computer connected, this VI returns an error.

This Express VI operates similarly to the following VIs and functions:

Open/Create/Replace File
Read from Text File
Read from Binary File
Read From Spreadsheet File
File Dialog
Scan From File

Example

Refer to the TDMS Express Read Data (Time Domain) VI in the labview\examples\File IO\TDMS\Express Read and Write directory for an example of using the Read From Measurement File Express VI.

 Open example  Find related examples