Skip to content Skip to navigation Skip to collection information

OpenStax_CNX

You are here: Home » Content » LabVIEW Graphical Programming » Graph Waveform Array VI

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

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

What is in a lens?

Lens makers point to 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 member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

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.
  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    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.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • eScience, eResearch and Computational Problem Solving

    This module is included inLens: eScience, eResearch and Computational Problem Solving
    By: Jan E. OdegardAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "eScience, eResearch and Computational Problem Solving" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

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

Graph Waveform Array VI

Module by: National Instruments. E-mail the author

Summary: To create an array by auto-indexing a For Loop and to plot the array on a waveform graph.

Exercise 1

Complete the following steps to build a VI that generates and plots an array on a waveform graph and modify the VI to graph multiple plots.

1.a) Front Panel

  1. Open a blank VI and build the front panel shown in Figure 1.
    Figure 1
    Figure 1 (graphwavaryfp.png)
    1. Place an array, located on the Controls>>All Controls>>Array &Cluster palette, on the front panel.
    2. Label the array Waveform Array.
    3. Place a numeric indicator, located on the Controls>>Numeric Indicators palette, in the array shell.
    4. Place a waveform graph, located on the Controls>>Graph Indicators palette, on the front panel.

1.b) Block Diagram

  1. Build the block diagram shown in Figure 2.
    Figure 2
    Figure 2 (graphwavarybd.png)
    1. tempicon.png Place the Thermometer VI on the block diagram. Select Functions>>All Functions>>Select a VI and navigate to C:\Exercises\ LabVIEW Basics I\Thermometer.vi. This subVI returns one temperature reading during each For Loop iteration.

      Note:

      Use the (Demo) Thermometer VI if you do not have a DAQ device available.
    2. forloop.png Place a For Loop, located on the Functions>>All Functions>>Structures palette, on the block diagram. In this exercise, each For Loop iteration generates a temperature value and stores it in the indexed tunnel. Create a constant of 100 for the count terminal.
    3. Wire the block diagram as shown in Figure 2.

      Note:

      When you wire data to charts and graphs, refer to the Context Help window for more information about wiring the objects, including whether to use a Build Array or Bundle function, the order of the input terminals, and so on. In general, use a waveform chart for single scalar points, a waveform graph for an array of y values, and an XY graph for an array of xx values and an array of yy values. For example, if you move the cursor over a waveform graph terminal on the block diagram, the information shown in Figure 3 appears in the Context Help window. Select Help>>Find Examples to launch the NI Example Finder, double-click Fundamentals, double-click Graphs and Charts, and double-click the Waveform Graph VI to open the example. Refer to the lesson on Data Acquisition and Waveforms for more information about the waveform data type.
      Figure 3
      Figure 3 (graphchelp.png)
  2. Save the VI as Graph Waveform Array.vi in the C:\Exercises\LabVIEW Basics I directory.

1.c) Run the VI

  1. Display the front panel and run the VI. The VI plots the auto-indexed waveform array on the waveform graph.
  2. Enter the index of any element in the Waveform Array index display to view the value of that element. If you enter a number greater than the array size of 100, the display dims.
  3. Use the Positioning tool to resize Waveform Array to view more than one element. The indicator displays elements in ascending index order, beginning with the index you entered.

1.d) Block Diagram

In this block diagram, you use the default value of the initial xx and Δx Δ x value for the waveform. In cases where the initial xx and Δx Δ x value are a specific value, use the Bundle function to specify an initial xx and Δx Δ x value for a waveform array.

  1. Modify the block diagram as shown in Figure 4.
    Figure 4
    Figure 4 (graphwavaryclusbd.png)
    1. bundle.png Place the Bundle function, located on the Functions>>All Functions>>Cluster palette, on the block diagram. This function assembles the plot elements into a single cluster. The elements include the initial xx value (2020), the Δx Δ x value (0.50.5), and the yy array of waveform data.
    2. Create two numeric constants for the initial xx value and Δx Δ x value.
    3. Label the Δx Δ x constant by typing Dx. Use the Labeling tool to select the D and select the Symbol font from the Text Settings pull-down menu on the toolbar. D converts to the delta symbol (Δ).
    4. Wire the block diagram as shown in Figure 4.
  2. Save the VI.

1.e) Run the VI

  1. Display the front panel and run the VI. The graph displays the same 100100 points of data with a starting value of 2020 and a Δx Δ x of 0.50.5 for each point on the x-axis. In a timed test, this graph would correspond to 5050 seconds worth of data starting at 2020 seconds.

    Note:

    Change the initial xx and Δx Δ x values in only one location, either the Bundle function or in the Waveform Graph Properties dialog box.
  2. If time permits, complete the optional steps. Otherwise, close the VI.

1.f) Optional

  1. Right-click the waveform graph and select Visible Items>>Graph Palette from the shortcut menu to display the graph palette. Click the Zoom button to see the data on the graph in more detail.
  2. Right-click the graph and select Visible Items>>Scale Legend from the shortcut menu to display the scale legend.
  3. Return to the block diagram. Create a multiple-plot waveform graph by building a 2D array of the data type normally passed to a single-plot graph. Modify the block diagram as shown in Figure 5.
    Figure 5
    Figure 5 ( tempanalybd.png)
    1. sineicon.png Place the Sine function, located on the Functions>>Arithmetic & Comparison>>Express Numeric>>Express Trigonometric palette, on the block diagram. Use this function to build an array of points that represents one cycle of a sine wave.
    2. BuildArrayicon.png Place the Build Array function, located on the Functions>>All Functions>>Array palette, on the block diagram. This function creates the data structure to plot two arrays on a waveform graph.
    3. pi.png Place the pi constant, located on the Functions>>Arithmetic & Comparison>>Express Numeric>>Express Numeric Constants palette, on the block diagram.
    4. Wire the block diagram as shown Figure 5.
  4. Save the VI.
  5. Display the front panel and run the VI. The two waveforms plot on the same waveform graph.
  6. Display the block diagram.
  7. Right-click the wire to Waveform Array , select Custom Probes>>Controls>>Graph Indicators from the shortcut menu, and select a waveform graph to place a graph probe on the wire.
  8. Display the front panel and run the VI. The probe shows only the data array. The sine wave is not present because you did not place the probe on the wire to which the sine wave is bundled.
  9. Close the Probe window.
  10. Zoom in on a portion of the graph.
    1. zoom.png Click the Zoom button on the graph palette, shown in Media 12, to display the Zoom pull-down menu.
    2. Select Zoom by X Rectangle, as shown in Figure 6.
      Figure 6
      Figure 6 (zoomxrect.png)
    3. Click and drag a selection rectangle on the graph. When you release the mouse button, the graph display zooms in on the selected area.
    4. You also can select Zoom by Y Rectangle or Zoom by Selected Area. Experiment with these options.
    5. xfit.png yfit.png Select Undo Zoom from the lower left corner of the pull-down menu to undo a zoom or click the x-axis single fit button and the y-axis single fit button on the scale legend, shown in Media 14 and Media 15.
  11. pan.png Use the Panning tool, shown in Media 16, to click and drag the graph display. Click the x-axis and y-axis single fit buttons again to restore the display to its original position.
  12. standard.png Use the Cursor Movement tool, shown in Media 17, to return the cursor to standard mode.
  13. Save and close the VI.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

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

What is in a lens?

Lens makers point to 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 member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

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

What is in a lens?

Lens makers point to 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 member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks