Connexions

You are here: Home » Content » Simple Data Logger VI
Content Actions
Lenses

What is a lens?

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...
Affiliated with (?)
This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • This module is included in aLens by: National InstrumentsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    National Instruments
Also in these lenses
  • This module is included inLens: Connexions Books Available for Print on Demand
    By: ConnexionsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "This book is available through the Connexions beta version of print-on-demand from online materials."

    Click the "Printable Books" link to see all content selected in this lens.

    Printable Books
Tags

(?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Simple Data Logger VI

Module by: National Instruments

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.

Problem 1

1.a) Simple Data Logger Block Diagram

  1. Open the Measurement Averaging VI located in the C:\Exercises\LabVIEW Basics I directory.
  2. Modify the block diagram to log the acquired data as shown in Figure 1.
    simpledataloggerbd.png
    Figure 1
    writelvm.png 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:
    1. Set the Action to Ask user to choose file for the filename.
    2. Set the 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.
    3. Set 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.
    4. Set the Delimiter to Tab to make it easy for a spreadsheet editor to determine where a column of data starts in the file.
    5. Click the OK button to close the dialog box.
    mergeerrorsicon.png Place the 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.
  3. Select File>>Save As to save the VI as Simple Data Logger.vi in the C:\Exercises\LabVIEW Basics I directory.
  4. Run the VI. A filename prompt appears. Name the file logger.lvm in the C:\Exercises\LabVIEW Basics I directory.
  5. Stop and close the VI.

1.b) Simple Data Reader Front Panel

  1. Open a blank VI and build the front panel shown in Figure 2 by placing a waveform chart, located on the Controls>>Graph Indicators palette, on the front panel.
simpledatareaderfp.png
Figure 2

1.c) Block Diagram

  1. Build the block diagram shown in Figure 3.
    simpledatareaderbd.png
    Figure 3
    1. readlvm.png 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:
      • In the Action section, place a checkmark in the Ask user to choose file checkbox.
      • Set the Segment Size to Retrieve segments of original size so that all the data stored in the file is retrieved.
      • Set 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.
      • In the Generic Text File section, remove the checkmark from the Read generic text files checkbox because the data is stored in a LabVIEW measurement file.
      • Click the OK button to close the dialog box.
    2. unbundle.png Place the Unbundle by Name function, located on the Functions>>All Functions>>Cluster palette, on the block diagram.
    3. or.png Place the Or function, located on the Functions>>Arithmetic & Comparison>>Express Boolean palette, on the block diagram.
    4. Wire the 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.
  2. Save the VI as Simple Data Reader.vi in the C:\Exercises\LabVIEW Basics I directory.
  3. Display the front panel, and run the VI. In the filename prompt that appears, select the logger.lvm file that you created earlier.
  4. The data that was stored in the LabVIEW Measurement File appears in the waveform chart.
    Note: You might need to rescale or autoscale the y-axis of the waveform chart to display the data.
  5. Close the Simple Data Reader VI.

Comments, questions, feedback, criticisms?

Discussion forum

Send feedback