Beruflich Dokumente
Kultur Dokumente
Overview
There are several options to save and report your measurement data in LabVIEW. Whether you want to log data to a file, save
data to a database, or programmatically decide what to do based on an operator decision or the conditions of your measurement,
LabVIEW has the functionality you need. This guide will show you how to record limit testing results to an Excel file using
LabVIEW.
This guide includes sample code. You can access it from the Downloads container on the right side of this page.
2. Quickly Save Data with the Write to Measurement File Express VI
Saving data is simple with the Write to Measurement File Express VI. You can use this function to configure how you'd like to save
your data, and it supports multiple file formats including TDMS, LabVIEW Measurement files, and the Excel file format.
1. Open Record Failure Points.vi from Saving Data to File.lvproj. This VI includes a prebuilt UI, signal simulation, and limit
testing that determines if the generated signal is within a specific range. In this guide, youll add the code to save the limit test
results to an Excel file.
2. First, add a Write to Measurement File Express VI to the Block Diagram. Right-click on the white space in the Block Diagram
1/3 www.ni.com
2. First, add a Write to Measurement File Express VI to the Block Diagram. Right-click on the white space in the Block Diagram
and navigate to File I/O Write to Measurement File. Click to place the VI on your diagram.
2/3 www.ni.com
Figure 4: Finished Block Diagram to record limit testing data
5. Test your code. Switch to the Front Panel and click the Run Arrow to run the application. You will be prompted to select a
location to save your Excel data. Give your file a name, and click OK. Run the VI for a few seconds, and move the Inject Noise
slider up and down to make sure you record some failure points. When you are finished, click the Stop button on your Front
Panel to stop the application running. Browse to the location you saved your data file, and open it in Excel. You should see four
columns of data - the value of the square wave, the failure points (if the data point was within the limits it passed, and you'll see
a value of #NV), and finally the upper and lower limits the test was comparing against.
3/3 www.ni.com