Additional Activities


Activity 9-7: Temperatures and Time Stamps

Build a VI that takes 50 temperature readings inside a loop, once every 0.25 seconds, and plots each on a chart. It also converts each reading to a string, and then concatenates that string with a Tab character, a time stamp, and an end of line character. The VI writes all of this data to a file. Save the VI as Temperature Log.vi.

  • Use the Tab and End of Line constants in the String palette.

  • Use Concatenate Strings to put all of the strings together.

  • Use Write Characters To File to save the data.

  • You can write data to a file one line at a time, but it is much faster and more efficient to collect all of the data in one big string using shift registers and Concatenate Strings, and then write it all to a file at one time.


You can look at your file using any word processing program, but it should look something like this:

78.9

11:34:38

79.0

11:34:39

79.0

11:34:50


Activity 9-8: Spreadsheet Exercise

Build a VI that generates a 2D array (three rows x 100 columns) of random numbers and writes the transposed data to a spreadsheet file (see Figure 9.49). (Save it with a ".csv" file extension so that it can be opened in your spreadsheet application, by double-clicking it.) The file should contain a header for each column as shown. Use the VIs from the Programming>>String and Programming>>File I/O palettes for this activity. Save the VI as Spreadsheet Exercise.vi.

Figure 9.49. Data generated during this activity, displayed in a spreadsheet application





LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net