From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

NI-9411 Quadrature Encoder LabVIEW FPGA Example Code

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.

    Hardware

  • cRIO-9012
  • cRIO-9112
  • NI-9411
  • PXI-7811

    Software

  • LabVIEW

    Operating System

  • Windows

Code and Documents

Attachment

Download All

Description

This example shows how to use multiple NI-9411 C Series Digital Modules in LabVIEW FPGA Interface programming mode. You will need to use LABVIEW FPGA Interface programming mode instead of Scan Interface proramming mode because the CompactRIO Chassis supports only two slots for specialty digital functions in Scan Interface programming mode. This example shows how to read quadrature encoder input signals on multiple modules.

How to Use

The attached example program demonstrates how to estimate velocity and acceleration of a Quadrature Encoder using the LabVIEW FPGA Module and CompactRIO hardware. This example consists of an FPGA VI, Encoder Position & Velocity (FPGA).vi, which will run on the FPGA platform and a host VI, Encoder Position & Velocity (Host).vi, which will run on the Host Machine. Additionally, the example program was designed for a PXI-7811R PXI Digital Reconfigurable I/O Module FPGA and an R Series expansion chassis with a NI-9411 DI module in slot 1.

Additional Information

The attached VI can easily be modified to run on any other CompactRIO FPGA hardware.

Related Links

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

Contributors