Example Code

Creating a Histogram Graph from a Spreadsheet File in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

1. Overview:
This example VI shows how to read data from one column of a spreadsheet file and create a histogram from the data


2. Description: 

This example shows how to use the General Histrogram.vi in order to build a histrogram from a spreasheet. In this case the spreasheet is a .txt file where the data is ordered in columns and the data is retrieved as a 2D Array. In order to get the histogram from the first column, the 2D Array mus be trasposed.

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Extract files in "Histogram from spreadsheet LabVIEW 2012 NI Verified.zip" 
  2. Histogram from spreadsheet LV2012 NI Verified.vi and spreasheet.txt must be in the same folder
  3. Set min, max and #bins parameters
  4. Run VI

5. Additional Information or References

 VI Block Diagram

 

 

Block Diagram.JPG

**This document has been updated to meet the current required format for the NI Code Exchange.**

Eric B.
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
jkurtw
NI Employee (retired)
on

Here's a more developed approach I had to do:

https://decibel.ni.com/content/docs/DOC-19001