How to Get Started With the Power Monitoring Starter Kit for NI CompactRIO

Publish Date: Aug 29, 2016 | 12 Ratings | 4.33 out of 5 | Print | Submit your review


This how-to guide walks you through the hardware and software setup of the Power Monitoring Starter Kit for NI CompactRIO. This starter kit uses the NI LabVIEW 2009 development environment but can be opened and updated for later versions.

Table of Contents

  1. Download the Power Quality Monitor Starter Kit for CompactRIO
  2. Power Quality Monitor Starter Kit Components
  3. Software Setup
  4. Advanced CompactRIO Programming
  5. Resources for Electrical Power and Utility Grid Applications

1. Download the Power Quality Monitor Starter Kit for CompactRIO

Download the Zip File

Back to Top

2. Power Quality Monitor Starter Kit Components

Note: For the latest NI CompactRIO chassis see and for the latest high voltage input modules see NI 9242 and NI 9244.

Model Description
cRIO-9024 800 MHz controller for CompactRIO system
cRIO-9111 4-slot chassis with Virtex-5 LX30 FPGA
NI 9225 3-channel 300 VRMS measurement module
NI 9227 4-channel 5 ARMS measurement module
NI 9901 Desktop mounting kit for CompactRIO system
NI 9971 High-voltage shield for module connections
PS-15 Power supply for CompactRIO system
  • LabVIEW 2009 SP1
  • LabVIEW 2009 SP1 Real-Time Module
  • LabVIEW 2009 SP1 FPGA Module
  • NI RIO Version 3.4


You can download the code below for LabVIEW Version 8.6.1. The C Series Software Support page lists all NI C Series products, the required version of LabVIEW, and the drivers needed to complete a system. LabVIEW 8.6.1 is the earliest version of LabVIEW that work with the Power Monitoring Starter Kit due to support for the NI 9225 and NI 9227 C Series modules.

Back to Top

3. Software Setup

Using the Starter Kit With the Power Quality Monitor Starter Kit Parts List.

Once you have your CompactRIO system up and running, you should be able to open the "PQ Starter Kit" and run it. If you get a broken arrow related to the bitfile, make sure it has not been moved. Double-click and find the ".lvbitx" file that is in the starter kit folder.

For more help on setting up a CompactRIO system, see the NI CompactRIO Setup and Services Page.

Using the Starter Kit With Different CompactRIO Hardware

This example was developed for deployment with the starter kit hardware. To run this project on different hardware, you need to configure a project to run your specific hardware connected to your computer. The following steps guide you through the process of creating a new project for your hardware.

1.       From the example LabVIEW Project Explorer, choose File » Save As...


2.       In the Save dialogue that appears, choose the Duplicate .lvproj file and contents radial button and ensure that the Include all dependencies radial button is selected. Then press Continue…


3.       Select a folder to store your new project and its associated files. Choose an appropriate name for the project file as well. All other project contents maintain the same name as used in the original example.


4.       Close the original example project.


5.       Open the newly saved project and right-click the top-level Project: <Name>, where <Name> is the title of your project. Then choose New » Targets and Devices…

6.       From the Add Targets and Devices dialogue that appears, choose the Existing target or device radial button and ensure that Discover an existing target(s) or devices(s) radial button is also selected if your device is on the same subnet as your development computer.


7.       Expand the Real-Time CompactRIO folder under Targets and Devices and choose your CompactRIO option from the list.

8.       Press OK.

9.       The Select Programming Mode dialogue box appears. It is important to choose the correct programming mode for your example. The Power Monitoring Starter Kit needs the chassis to be configured for FPGA interface mode rather than scan mode. You have the choice to discover installed modules. Though either way works, adding the modules later is easier. You should now have a project (as depicted below) with two targets, the original “DEMO-9024” target and the new one you just added. The idea now is to drag all of the components from the original target to your new target.

10.   Drag the VI under the old RT CompactRIO controller and place it under the new CompactRIO controller you just added to the project in the same relative location. Note that the VIs need to be placed under the proper targets. “PQ Host Program” should live under the RT target, and “[FPGA] Main” should be pulled under the FPGA target on the chassis. Don't forget the “DATAU32” DMA channel from the FPGA target. The image below shows the “PQ Host Program” after it has been moved from the original target to the new one.



11.   For the folders, create a virtual folder and convert it to “auto-populating” to pull in all the subVIs. Select the appropriate folder from the project folder on disk.


12.   Channel address names are important. The easiest way to use similar names is by following these steps:

a.      Add “C Series Modules” by right-clicking on the FPGA target

b.      Delete the associated folder that is automatically created (usually named “Mod#”)

c.      Change the name of the module to match the name in the PQ Starter Kit project (for example, I or V for current or voltage)

d.      Right-click on the newly named module and select New » FPGA I/O

e.      Channels are now addressed based on the module name


13.   After you have created folders, moved VIs, and discovered modules, you can remove the old system from the project by right-clicking it and selecting Remove from Project.


14.   Open the [FPGA] Main program and note that the run arrow is broken. This is normal. You need to make a few adjustments before the program can execute on your new target.

a.       Synchronize the NI 9225 and NI 9227 modules by right-clicking one of them, going to Properties, and checking “Export Onboard Clock.”

b.      On the other module, go to Properties and use the “Master Timebase Source” pull-down to select the module for which you just exported the onboard clock. The modules can now synchronize within the chassis.

c.       Check for broken wires. If the channel address names are not correct, there may be a broken wire on the I/O nodes. Channel order is important, so note the V0, I0, V1, I1… pattern (see image below).

d.      Once all of the broken wires are gone, save and close the VI.   


15.   Open the “PQ Host Program” and press the Run button on the front panel. Before the example runs, you are prompted to compile the FPGA VI. Once you have completed this compilation, the example runs automatically. Compilation is system-dependent but should take around 20 minutes.


Back to Top

4. Advanced CompactRIO Programming

For more advanced design and application development, use the CompactRIO Developers Guide. This document provides a consolidated and comprehensive understanding of the many applications for CompactRIO and the best methods to develop for these applications.

For more personal instruction on CompactRIO development, you may be interested in an instructor-led class provided by National Instruments. Classes in real-time application development and LabVIEW FPGA provide the foundation for a variety of CompactRIO applications. Visit for more details.


Back to Top

5. Resources for Electrical Power and Utility Grid Applications

The Power Monitoring Starter Kit for NI CompactRIO uses an early version of code that has since been incorporated into the free Base Edition of the LabVIEW Electrical Power Suite.  Though the capabilities of the VIs between the earlier code and the new toolkit are similar, they are not drop in replacements and updates to the calculation VIs of the Starter Kit code would need to be made to upgrade it to the Electrical Power Suite.  This is optional but not required to use the above referenced code.  

Power Quality Reference Architecture

The Power Quality Reference Architecture is code developed by NI systems engineers for use in deployed, embedded power monitoring systems and is a more robust, extensible code base for power monitoring system development than the Power Monitoring Starter Kit.

To learn more about the hardware and sensor connectivity, read the How to Measure Voltage, Current, and Power white paper.


Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No