Example Code

Histogram for FPGA

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 FPGA Module
  • LabVIEW

Code and Documents

Attachment

Overview

This example shows how to implement an histogram processing in FPGA

 

Description

One important application for LabVIEW FPGA is data reduction. This technique is used so applications do not have to transfer, store, and post process large amounts of raw data. With the on-board processing power of the FPGA this function creates a distribution of the data in the form of a histogram that can run in real time as the data is acquired.

 

This function implements a histogram for the FPGA with up to 1024 bins. Under the hood it uses local FPGA memory block to store the counter values for each bin. In the normal mode (fill bin) the VI will take an input and and increment the counter value for the correct bin. However, the VI has multiple modes including fill bins, get bin, clear bin, and clear all bins. This download includes the Histogram IP and a project with an example program using each feature of the histogram VI. There is more detailed documentation for the VIs on the block diagrams.

 

Requirements

LabVIEW 2012 (or Compatible)

 

Steps to Implement or Execute Code

  1. Run the program and put 10 numbers into the Histogram by choosing and number and pressing "update" for each one

Main VI Snippet:

FPGA Histogram LV_2012_NI_Verified.png

 

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

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