Additional Information
| Note: LabVIEW does not support front panel data logging through remote panels. |
Automatic Data Logging:
- The first time you log front panel data for a VI, LabVIEW prompts you to name the datalog file. You can use any file extension, for example .dat or .txt, for datalog files.
- LabVIEW logs data each time you run the VI and appends a new record to the datalog file each additional time you run the VI. You cannot overwrite a record after LabVIEW writes it to a datalog file.
Interactive Data Logging:
- LabVIEW appends the data to the datalog file immediately. Log your data interactively so you can select when to log the data. Logging your data automatically logs the data each time you run the VI.
| Note: If you display a subVI or an Express VI as an expandable node, you cannot enable database access for that node. |
Specifying Records:
The subVI has n logged records, and you can wire any number from –n to n – 1 to the
record # terminal of the subVI. You can access records relative to the first logged record using non-negative record numbers. 0 represents the first record, 1 represents the second record, and so on, through n – 1, which represents the last record.
You can access records relative to the last logged record using negative record numbers. –1 represents the last record, –2 represents the second to the last, and so on, through –n, which represents the first record. If you wire a number outside the range –n to n – 1 to the
record # terminal, the
invalid record # output is TRUE, and the subVI retrieves no data.
LabVIEW Data Directory:
Use the default LabVIEW Data directory to store the data files LabVIEW generates, such as .lvm or .txt files. LabVIEW installs the LabVIEW Data directory in the default file directory for your operating system to help you organize and locate the data files LabVIEW generates. By default, the Write To Measurement File Express VI stores the .lvm or .tdm files it generates in this directory, and the Read From Measurement File Express VI reads from this directory. The default data directory constant and the
Application:Default:Data Directory property also return the LabVIEW Data directory by default.
Select
Tools»Options and select
Paths from the
Category list to specify a different default data directory. The default data directory differs from the default directory, which is the directory you specify for new VIs, custom controls, VI templates, or other LabVIEW documents you create.
Text-Based Measurement File:
The text-based measurement file (.lvm) includes data the
Write To Measurement File Express VI generates. The text-based measurement file is a tab-delimited text file you can open with a spreadsheet application or a text-editing application. In addition to the data an Express VI generates, the .lvm file includes 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 .lvm file.
Use the
Read From Measurement File Express VI to
read data from a .lvm file.
The .lvm file uses commas as delimiters between numbers. To convert data in a .lvm file from a string to a number, specify the decimal separator as a period by using the
localization code format specifier.
Binary Measurement File:
The binary measurement file (.tdm or .tdms) includes data the Write To Measurement File Express VI, the
Storage/DataPlugin VIs, or the
TDM Streaming VIs and functions generate. The .tdm file uses an XML-based format to store waveform properties and links to a binary file that contains waveform data. The .tdms file stores waveform properties and is a binary file that contains waveform data. Binary measurement files provide higher accuracy, take up less space on disk, and perform faster than LabVIEW measurement data files (.lvm).
You can use a binary measurement file to exchange data between NI software, such as LabVIEW and DIAdem.
(Windows) You can use the Read From Measurement File Express VI and the Write To Measurement File Express VI to read data from and
write data to .tdm files. You can use the Storage/DataPlugin VIs to
read data from and write data to .tdm files. You can use the
TDM Streaming VIs and functions to read data from and write data to .tdms files.