1. Download the Power Quality Monitor Starter Kit for CompactRIO
2. Power Quality Monitor Starter Kit Components
The starter kit was developed with the components listed in the table below. See prices and descriptions on the Power Quality Monitor Starter Kit Parts List.
|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|
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.
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.
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 ni.com/training for more details.