Your objective is to modify a VI that saves data to a new ASCII file you can access from a spreadsheet application.
Front Panel
Open the Graph Waveform Arrays VI by selecting File»Open and navigating to labview\activity\Graph Waveforms.vi.
The Graph Waveform Arrays VI generates two arrays of waveform data and plots them on a graph.
Click the Run button to run the VI. Notice two different waveforms are drawn on the graph.
Block Diagram
Open the block diagram by selecting Window»Show Diagram or press <Ctrl-e>. Macintosh Press <Command-e>.
Add a Write To Spreadsheet File VI, available from the Functions»File I/O palette, to the lower right of the block diagram. The Write to Spreadsheet VI converts the two-dimensional (2D) array to a spreadsheet string and writes it to a file. If you do not specify a pathname to the File Path terminal, a file dialog box appears when you run the VI and prompts the user for a file name.
Use the Wiring tool to wire between the output of the Build Array function and the Waveform Graph terminal to the 2D data terminal of the Write to Spreadsheet File VI.
For this activity, transpose the 2D array to have each column of the spreadsheet file contain a data array. Use the Wiring tool to right-click the Transpose? (no:F) terminal and select Create»Constant from the shortcut menu. This Boolean constant controls whether or not LabVIEW transposes the 2D array before writing the data to file.
Move the cursor over the center of the Boolean constant. LabVIEW selects the Operating tool. Click the Boolean constant to change the value to TRUE.
Your block diagram should look similar to the following illustration.
Select File»Save As to save a copy of the VI. From the standard File dialog box that appears, name the new VI Arrays to File.vi and save it in the labview\activity directory.
Running the VI
Select Window»Show Panel, click the front panel window, or press <Ctrl-e> to return to the front panel window. Macintosh Press <Command-e>.
Click the Run button to run the VI. After the VI generates the data arrays, a standard File dialog box prompts you for the file name of the new file you are creating. Type in a file name and click OK.
Use spreadsheet software or a text editor to open and view the file you just created. You should see two columns of 100 elements.
End of Activity 8. Save Data to a Spreadsheet File