Summary: In this exercise, the objective is to learn to use a LabVIEW Measurement File. Complete the following steps to modify the Measurement Averaging VI to log the acquired data to a LabVIEW Measurement File. Create another VI that reads the data file.
Measurement Averaging VI located
in the C:\Exercises\LabVIEW Basics I
directory.
![]() Figure 1 |
Place the Write LabVIEW
Measurement File Express VI, located on the
Functions>>Output palette, on the block
diagram. This Express VI stores the data acquired from
the DAQ device. In the Configure Write LabVIEW
Measurement File dialog box that appears, set the
following options:
Action to Ask user to
choose file for the filename.
Segment Headers to One
header only to provide a header for all of
the data. The header contains information about the
sampling rate and the time when the sample was
taken.
X Value Columns to One column
per channel to provide a table of data that
can be read by any spreadsheet editor or an ASCII
text file editor.
Delimiter to Tab
to make it easy for a spreadsheet editor to
determine where a column of data starts in the file.
OK button to close the dialog
box.
Merge Errors VI,
located on the Functions>>All Functions>>Time
& Dialog palette, on the block diagram. It is
important to catch errors with both DAQ and file I/O,
and because the code has a parallel structure it is
necessary to merge the errors from all of the parallel
operations to determine if the code is functioning
properly.
File>>Save As to save the VI as
Simple Data Logger.vi in the
C:\Exercises\LabVIEW Basics I directory.
logger.lvm in the
C:\Exercises\LabVIEW Basics I directory.
Controls>>Graph Indicators palette, on
the front panel.
![]() Figure 2 |
![]() Figure 3 |
Place the Read LabVIEW
Measurement File Express VI, located on the
Functions>>Input palette, on the block
diagram. Because this Express VI reads data located
in a LabVIEW measurement file one data point at a
time, it must be placed in a loop. In the
Configure Read LabVIEW Measurement File
dialog box that appears, set the following options:
Action section, place a
checkmark in the Ask user to choose
file checkbox.
Segment Size to
Retrieve segments of original size
so that all the data stored in the file is
retrieved.
Time Stamps to Relative
to start of measurement. Because the
dynamic data type stores information about the
signal timing, this setting aligns the data with
the time of the measurement.
Generic Text File section,
remove the checkmark from the Read generic
text files checkbox because the data is
stored in a LabVIEW measurement file.
OK button to close the
dialog box.
Place the Unbundle by Name function,
located on the Functions>>All
Functions>>Cluster palette, on the block
diagram.
Place the Or
function, located on the Functions>>Arithmetic
& Comparison>>Express Boolean palette, on
the block diagram.
EOF? output of the Read
LabVIEW Measurement File function to the
Or function. Wire the
status output of the error cluster to
the second input of the Or function.
This stops the While Loop when the
entire LabVIEW Measurement File has
been read or when an error occurs.
Simple Data Reader.vi in the
C:\Exercises\LabVIEW Basics I directory.
logger.lvm
file that you created earlier.
Simple Data Reader VI.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."