Example Code

NI CompactRIO Waveform Acquisition and Generation for System Characterization (FRF)

Code and Documents

Attachment

Download All

Description

Overview

The following project contains host VIs, FPGA templates, and example projects for performing waveform data acquisition and waveform data generation on NI RIO hardware. The configuration and acquisition VIs incorporate optimizations and best practices for the RIO platform, and you can easily modify the examples to jump-start your application development.

In addition, the tools put together will allow NI RIO hardware to be easily used with other NI tools like Control Design and Simulation Module, Sound and Vibration Measurement Suite and other LabVIEW examples that expects waveform as data types.

 

The motivation for this development was being able to perform characterization of a plant where part of the plant is implemented in the FPGA and other regular DAQ devices cannot be used to measure the logic channels.

 

utilization.png

 

 

Description

The Project cRIOWfm_IO contains the functionality of the NI CompactRIO Waveform Reference Library with the addition of an waveform generation API. There are templates for both waveform acquisition and waveform generation in the project. They are intended to be used in a very analogous way compared to DAQmx driver.

The file structure of this project is completely independent from the NI CompactRIO Wavefrom Reference Library, so you can have both tools or just one of them without dependencies or conflicts.

 

The Project FRF+cRIO contains the modified version of Discrete Swept-Sine FRF example to work with the API from the first project.

Projects are separated just for convenience, as you can download just the first project if not interested in characterization or system modeling.

 

A demonstration of both project functionalities when characterizing a RC passive filter can be watched in this 4 minute video:

 

 

 

 

Hardware and Software Requirements

For the cRIOWfm_IO Project:

  • Compatible cRIO Controller (903x, 906x)
  • Compatible I/O Modules (92xx)
  • LabVIEW Full Developement System 2017 or newer
  • LabVIEW Real-Time and FPGA Modules
  • NI-RIO 17.0 or newer

For the FRF+cRIO Project:

  • All from first project, plus:
  • NI Sound and Vibration Measurement Suite

Steps to Implement or Execute Code

Download the projects and unzip them in your computer.

The cRIOWfm_IO is configured for a cRIO-9068, 9215 and 9263 modules. If you have a different hardware, make the necessary changes following the included VIs documentations and recompile the FPGA properly.

 

The FRF+cRIO project refers to contents of the cRIOWfm_IO project. So you might need to point to new locations in your computer, including the new Bitfile before the first run. 

You can also merge the two projects if you find more convenient.

 

Additional Information or References

NI CompactRIO Waveform Reference Library

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

Comments
zo
Member
Member
on

Hello,

 

First of all this is a really nice project here, thanks for uploading. It means cards like the NI 9262 Analog output can be used which is not compatible with DAQmx.

 

Is there a way to speed the code up? I would like to use this with NI 9223 and NI 9262 at 1 MHz. The acquisition loop seems to max out at 357 kHz and generation at 526 kHz on the FPGA. Currently I'm trying to merge in the example code for these cards but am encountering FIFO timeout errors. I am using a cRIO 9045.