Complete the following steps to write each record to a file in the form of a cluster.
- Place the Open/Create/Replace Datalog function on the block diagram.
- Right-click the operation input of the Open/Create/Replace Datalog function and select Create»Constant from the shortcut menu. Select create from the ring constant that appears.
- Create a cluster that matches the data record and wire the cluster to the record type input of the Open/Create/Replace Datalog function. The cluster specifies how LabVIEW writes the data to the file.
- Place the Write Datalog function on the block diagram.
- Wire the refnum out output of the Open/Create/Replace Datalog function to the refnum input of the Write Datalog function.
- Create a control or constant to represent the data record and wire it to the record(s) input of the Write Datalog function.
- Close the datalog file.
- Place the Close File function on the block diagram.
- Wire the refnum out output of the Write Datalog function to the refnum input of the Close File function.
- After you write to a datalog file, read the file.
Refer to the Write Datalog File Example VI in the labview\examples\file\datalog.llb for an example of saving a simulated temperature reading and the time stamp in a LabVIEW datalog file.