Datalog Files
- Updated2026-05-01
- 2 minute(s) read
Use datalog files to access and manipulate data as binary within LabVIEW only. Datalog files store complex data structures quickly and easily.
A datalog file stores data as a sequence of identically structured records, similar to a spreadsheet, where each row represents a record. Each record in a datalog file must have the same data types associated with it. LabVIEW writes each record to the file as a cluster that contains the data to store. However, the components of a datalog record can be any data type, which you determine when you create the file.
For example, you can create a datalog whose record data type is a cluster of a string and a number. In this case, each record of the datalog is a cluster of a string and a number. The contents of individual records can still differ: the first record could be ("abc",1), while the second record could be ("xyz",7).
Datalog files have the following advantages:
- Datalog files require little manipulation, which makes writing and reading much faster.
- Datalog files simplify data retrieval because you can read the original blocks of data back as a record without having to read all records that precede it in the file.
- Random access is fast and easy with datalog files because all you need to access the record is the record number. LabVIEW sequentially assigns the record number to each record when it creates the datalog file.
You can change the record data type of a datalog file. However, changing the record data type of a datalog file is like changing the file format.
- When you change the record data type, you must update any VIs you created to manipulate those records to read the new data type.
- Once you update your VIs, they cannot read any datalog files that were created with the old record data type.
You can create datalog files in the following ways:
- Access datalog files from the front panel and from the block diagram.
In this case, LabVIEW writes a record to a datalog file each time the associated VI runs. When you read a datalog file, you can read one or more records at a time.
- Use front panel data logging, which records data for use in other VIs and in reports.
Datalog File Examples
For examples of reading and writing datalog files, refer to labview\examples\File IO\Datalog\Datalog File.lvproj.