Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Spreadsheet Example 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.
 

Spreadsheet Example VI

Module by: National Instruments. E-mail the author

Summary: In this exercise, the objective is to save a 2D array in a text file so a spreadsheet application can access the file and to display numeric data in a table. Complete the following steps to examine a VI that saves numeric arrays to a file in a format you can access with a spreadsheet.

Exercise 1

1.a) Front Panel

  1. Open the Spreadsheet Example VI located in the C:\Exercises\LabVIEW Basics I directory. The front panel in Figure 1 is already built.
    Figure 1
    Figure 1 (spreadex.png)

1.b) Run the VI

  1. Run the VI. The VI generates a 2D array of 128rows×3columns 128 rows 3 columns . The first column contains data for a sine waveform, the second column contains data for a noise waveform, and the third column contains data for a cosine waveform. The VI plots each column in a graph and displays the data in a table.
  2. When the Choose file to write dialog box appears, save the file as wave.txt in the C:\Exercises\LabVIEW Basics I directory and click the OK button. Later, you will examine this file.

1.c) Block Diagram

  1. Display and examine the block diagram for this VI.
    Figure 2
    Figure 2 (spreadexbd.png)
    • sinepaticon.png The Sine Pattern VI located on the Functions>>All Functions>>Analyze>>Signal Processing>>Signal Generation palette returns a numeric array of 128 elements containing a sine pattern. The constant 90.0, in the second instance of the Sine Pattern VI, specifies the phase of the sine pattern or cosine pattern.
    • uniform.png The Uniform White Noise VI located on the Functions>>All Functions>>Analyze>>Signal Processing>>Signal Generation palette returns a numeric array of 128 elements containing a noise pattern.
    • BuildArrayicon.png The Build Array function located on the Functions>>All Functions>>Array palette builds the 2D array from the sine array, noise array, and cosine array, as shown in Figure 3.
      Figure 3
      Figure 3 (BuildArray.png)
    • trans2daryicon.png The Transpose 2D Array function located on the Functions>>All Functions>>Array palette rearranges the elements of the 2D array so element ij i j becomes element ji j i , as in Figure 4.
      Figure 4
      Figure 4 (transarry.png)
    • wrtspreadfileicon.png The Write To Spreadsheet File VI located on the Functions>>All Functions>>File I/O palette formats the 2D array into a spreadsheet string and writes the string to a file. The string has the format shown in Figure 5, where an arrow indicates a tab, and a paragraph symbol (¶) indicates an end of line character.
      Figure 5
      Figure 5 (writespread.png)
    • num2fracstrgicon.png The Number To Fractional String function located on the Functions>>All Functions>>String>>String/Number Conversion palette converts an array of numeric values to an array of strings that the table displays.
  2. Close the VI. Do not save changes.

    Note:

    This example stores only three arrays in the file. To include more arrays, increase the number of inputs to the Build Array function.

1.d) Optional

Open the wave.txt file using a word processor or spreadsheet application and view its contents.

  1. Open a word processor or spreadsheet application, such as (Windows) Notepad or WordPad, (Mac OS) SimpleText, or (UNIX) Text Editor.
  2. Open wave.txt. The sine waveform data appear in the first column, the random waveform data appear in the second column, and the cosine waveform data appear in the third column.
  3. Exit the word processor or spreadsheet application and return to LabVIEW.

Content actions

Download module as:

Add 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