1. Required Software for NI 9148
- LabVIEW 2010
- LabVIEW 2010 FPGA Module1
- NI-RIO 3.5.1
Note: Software should be installed in the order listed.
1LabVIEW FPGA is only necessary if you plan to write your own field-programmable gate array (FPGA) program for the FPGA target in NI 9148. Use of the Scan Mode Interface is possible without the LabVIEW FPGA Module.
2. Required Software for the NI 9146
- LabVIEW 2011
- LabVIEW 2011 FPGA Module1
- NI-RIO 4.0
Note: Software should be installed in the order listed
1LabVIEW FPGA is only necessary if you plan to write your own FPGA program for the FPGA target in NI 9146. Use of the Scan Mode Interface is possible without the LabVIEW FPGA Module.
3. Setting Up the Hardware
In this section, walk through the steps to set up the hardware for the NI 9148 Ethernet RIO expansion chassis. The steps detailed in this tutorial are the same for the NI 9146 Ethernet RIO expansion chassis with the exception of the minimum software requirements detailed above.
Installing C Series Modules
Complete the following steps to install a C Series I/O module in the chassis:
- Make sure that no I/O side power is connected to the module. Due to the hot-swappable ability of the C Series module, if the system is in a nonhazardous location, the chassis power can be on when you install modules.
- Align the C Series module with a module slot in the chassis as shown in Figure 1. The module slots are labeled 1 to 8, left to right.
- Squeeze the latches and insert the module into the module slot.
- Press firmly on the connector side of the C Series module until the latches lock the module into place.
- Repeat these steps to install additional I/O modules.
Figure 1. Inserting an I/O Module in the Chassis
Connecting Ethernet and Power
Ethernet RIO systems use Ethernet for all communication and configuration back to the development or host PC. To connect to an Ethernet network (hub or router), use a standard Category (CAT-5) or better shielded, twisted-pair Ethernet cable, or use an Ethernet crossover cable to connect the chassis directly to your development computer.
Before wiring power, ensure that your dip switches are in the OFF position (NI 9148 only). All dip switches should be in the OFF position when the chassis is shipped from National Instruments.
- Ensure the power supply is not energized (in other words, not plugged into a power source) before connecting any wires.
- Remove the COMBICON power connector from the front of your Ethernet RIO chassis by loosening the two captive screws that hold it in place.
- Connect the positive lead of the power supply to the V1 or V2 terminal (NI 9148) or to the V terminal (NI 9146), and the negative lead to one of the C terminals on the power connector that was shipped with your Ethernet RIO chassis. Tighten the leads in the connector by turning the captive screws on the side of the connector and ensure the wires are snugly in place.
- Reattach the COMBICON connector to your Ethernet RIO chassis.
4. Configuring Your Hardware
- Disable secondary network interfaces, such as the wireless access card on a laptop. For initial setup, National Instruments software searches for your NI CompactRIO system through the primary network interface on your computer. Disabling all additional network interfaces ensures that your CompactRIO system is easy to find on the network.
- Open Measurement & Automation Explorer (MAX) by going to Start»All Programs»National Instruments»Measurement & Automation and Expand Remote Systems. You should see your Ethernet RIO system in the list. By default, your reconfigurable I/O (RIO) system will either acquire a network address via DHCP if it is supported on your network, or if you are connected directly to your PC via a cross over cable, it will assign a link local address.
If you do not see your system, follow the steps outlined in the document titled Troubleshoot When NI CompactRIO Does Not Appear in Measurement & Automation Explorer (MAX).
5. Installing Software on Your Ethernet RIO Expansion Chassis
Your Ethernet RIO chassis should be configured with a valid IP address and the correct software should be installed on your development computer by this point. The status light on your Ethernet RIO chassis should be repeatedly blinking twice. This indicates that a valid IP address is assigned, but there is no software installed on the controller.
- Expand the CompactRIO item under Remote Systems, right-click on the Software item, and select Add/Remove Software.
- Select the most recent NI-RIO Recommended Software Set (RSS) and click Next. Continue clicking Next until the software install wizard begins installing software on the controller. The process of installing software can take a few minutes, so feel free to go grab a cup of coffee or check your email while the wizard completes the install process.
- Once the process is completed click the Finish button and close MAX. Your Ethernet RIO system will now reboot. After it has finished rebooting, your system is ready to program and use.
6. Programming Your Ethernet RIO Expansion Chassis
- Start by opening LabVIEW and clicking on the Empty Project item in the LabVIEW getting started screen.
- Right-click the Target item in the project tree and select New»Targets and Devices…
- Double-click on the Ethernet RIO folder, select your chassis, and click OK.
- The next window asks you to select your programming mode. If you have the LabVIEW FPGA Module, you have the option to use the LabVIEW FPGA Interface. This is the more powerful and flexible way to interface with your RIO hardware. However, without the LabVIEW FPGA Module you can use the Scan Interface Mode. Click on the mode you want to use and click Continue.
- Your Ethernet RIO chassis is now added to the project. Expand the Ethernet RIO item and the chassis item in the project tree to see your available modules. Expand a module item to see the available I/O channels. Your project now looks something similar to the image below.
- Click Save and save your project in a location you can find it again.
Now you will create a simple LabVIEW program referred to as a VI, or virtual instrument, that will access the Ethernet RIO I/O across the network from your Windows machine.
- Right-click the My Computer item in the project tree and select New»VI to add a new VI to your project.
- Navigate to the block diagram and add a While Loop from the functions palette. Then drag and drop an I/O Scan Variable from the project tree into the While Loop.
- Create an indicator for your I/O variable and ensure that a Stop control is wired to the loop condition. Your block diagram should look similar to the image below.
- Save your VI and click the Run Arrow from your front panel. You are now accessing I/O from your NI 9148 chassis across the network from your development PC using the Scan Mode Interface.
- Your Ethernet RIO chassis is now added to the project. Expand the Ethernet RIO item, the chassis item, and the FPGA Target in the project tree to see your available modules. Expand a module item to see the available I/O channels. Your project now looks something similar to the image below.
- Click Save and save your project in a location you can find it again.
Now you will create a LabVIEW FPGA VI that will be compiled to the FPGA target on your Ethernet RIO. From there, you will create a Host VI that will run on the PC and communicate with the FPGA VI on the Ethernet RIO FPGA Target.
- Right-click the FPGA Target item in the project tree and select New»VI to add a new FPGA VI to your project.
- Navigate to the block diagram and add a While Loop from the functions palette. Then drag and drop an I/O Node from the project tree into the While Loop.
- Create an indicator for your I/O Node and ensure that a false constant is wired to the loop condition. Your block diagram should look similar to the image below.
- Save your VI and click the Run arrow from your front panel. This launches the FPGA Compiler, which compiles your FPGA VI for the FPGA Target.
- Right-click the My Computer item in the project tree and select New»VI to add a new Host VI to your project.
- Navigate to the block diagram and add a While Loop from the functions palette. Then add Open FPGA VI Reference, Read/Write Control, and Close FPGA VI functions into the While Loop and wire them as seen in the image below.
- Right-click on the Open FPGA VI Reference and select Configure Open FPGA VI Reference. Select the VI Radio Button and then browse to your FPGA VI. This points your host VI to your FPGA VI that is running on the FPGA Target.
- Save your VI and click the Run arrow from your front panel. You are now accessing I/O from your Ethernet RIO chassis across the network from your development PC using FPGA programming.