Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Aug 03, 2012


Feedback


Yes No

Related Links - Developer Zone

Related Links -Products and Services

Connect an Ethernet RIO Expansion Chassis to a Secondary Ethernet Port on a Real-Time Controller

0 Ratings | 0.00 out of 5
Read in  |  Print |  PDF

Overview

The Ethernet RIO expansion chassis is intended to be connected to a switch, router, or existing Ethernet network; however, you can connect it to the secondary port of a real-time controller. When using real-time controllers with two Ethernet ports, Ethernet port 1 is used for communication between the real-time controller and the host PC. This includes communicating with the controller via NI LabVIEW system design software and Measurement & Automation Explorer (MAX). Ethernet port 2 is used to communicate with a private network, which is not visible to the host PC. In this tutorial, learn how to communicate with an Ethernet RIO expansion chassis when you connect it to the secondary port of a dual Ethernet port LabVIEW real-time controller.

Note that connecting an Ethernet RIO expansion chassis to the secondary Ethernet port of a real-time controller is not the intended use case for the Ethernet RIO expansion chassis. If you wish to use this configuration, you should consider using the NI EtherCAT RIO slave chassis. See more information on EtherCAT RIO.

This example uses NI cRIO-9074 for the dual-port LabVIEW real-time controller; however, you can use this process for any dual-port LabVIEW real-time controller. The NI 9148 was the Ethernet RIO expansion chassis that was used, but the process is the same for all Ethernet RIO expansion chassis.

Table of Contents

  1. Requirements
  2. Configure the Ethernet RIO Expansion Chassis and Deploy the Application
  3. Configure the Real-Time Controller With the Ethernet RIO Expansion Chassis
  4. Next Steps

Requirements

  1. Any dual Ethernet port LabVIEW real-time controller
  2. LabVIEW 2010 or later1
  3. LabVIEW 2010 Real-Time Module or later (only required for the real-time controller)
  4. LabVIEW 2010 FPGA Module or later2
  5. NI-RIO 3.5.1 or later1
  6. Ethernet crossover cable
Note: Software should be installed in the order listed.

1 LabVIEW 2010 and NI-RIO 3.5.1 is the minimum version of LabVIEW that you can use with the NI 9148 Ethernet RIO. If you’re using a different Ethernet RIO expansion chassis, you will need to consult your documentation for the minimum software requirements.

2 The LabVIEW FPGA Module is necessary only if you plan to write your own FPGA program for the FPGA target on the Ethernet RIO expansion chassis. It is possible to use the Scan Mode Interface without the module.

Configure the Ethernet RIO Expansion Chassis and Deploy the Application

First you need to configure both targets, the NI 9148 and cRIO-9074 (one at a time), and the host PC with a static IP. Once communication has been established, you deploy a VI and a Shared Variable Library to the NI 9148.

1. Figure 1 shows the final configuration of the host PC, real-time controller, and NI 9148. Notice that the host PC and Port 1 of the real-time controller are on the same subnet while Port 2 and the Ethernet RIO expansion chassis are on the same subnet (yet different from Port 1 and the host PC).

Figure 1. Final Configuration

2. Connect the NI 9148 to a DHCP switch, router, or your enterprise network via a generic Ethernet cable. Open MAX on your host PC. The NI 9148 should be visible in MAX under Remote Systems. If a remote system target does not appear in MAX, enable the IP RESET DIP switch on the controller, reboot the controller, and then disable the IP RESET DIP switch.

3. Select the NI 9148 under Remote Systems. Ensure that Static is selected under the Network Settings tab. Once you have set the static IP, click Save and reboot the controller. Refer to Figure 2.

Figure 2.bmp

Figure 2. NI 9148 With Static IP (192.168.0.2)

4. Set your host PC to a static IP. If you are using Windows 7, navigate to Control Panel » Network and Sharing Center » Change Adapter Settings. Set the PC to a static IP address. This example uses 192.168.0.1.

5. Open LabVIEW and create a new project. In the project, add the NI 9148 (Figure 3) and create a new VI (Test VI.vi) under My Computer to begin acquiring data as seen in Figure 4. You must deploy the NI 9148 before connecting it to the secondary port of the real-time controller. Deploy the NI 9148 from the project by selecting the NI 9148, right-click, and select deploy all. If you do not deploy the NI 9148 before connecting to the secondary port, the host PC will not recognize the NI 9148.

Figure 3.bmp

Figure 3. LabVIEW Project With NI 9148 and NI 9211

Figure 4.bmp

Figure 4. Block Diagram and Front Panel of Data Acquisition

Configure the Real-Time Controller With the Ethernet RIO Expansion Chassis

1. Select the NI 9148 under Remote Systems in MAX. Under the Network Settings tab, change the IP address from the current IP address (192.168.0.2) to a new IP address on a different subnet. This example changes the NI 9148 IP address to 10.0.18.3. By doing this, the host PC can no longer see the NI 9148.

2. After setting the new IP address of the NI 9148, you need to configure the real-time controller. Connect the cRIO-9074 directly to the host PC via a generic Ethernet cable or an Ethernet crossover cable. Check under Remote Systems in MAX for the cRIO-9074. If a remote system target does not appear in MAX, enable the IP RESET DIP switch on the controller, reboot the controller, and then disable the IP RESET DIP switch.

3. Select the cRIO-9074 under Remote Systems. Ensure that Static is selected for Ethernet Adapter eth0 (Primary) under the Network Settings tab. The Primary Ethernet Adapter refers to the primary Network Interface Controller (NIC) on the cRIO-9074. Set the primary NIC to a static IP (192.168.0.2) as seen in Figure 5.

4, Set the secondary NIC of cRIO-9074 to a static IP address. To change the IP address of the secondary NIC on the cRIO-9074, go to the Network Settings tab in MAX also seen in Figure 5. This example uses 10.0.18.1 for the IP address of the secondary NIC.

Figure 5.bmp

Figure 6. Configure Secondary NIC

5. Connect the NI 9148 via a crossover cable to the secondary NIC on cRIO-9074.

6. In the project, move the VI you created in Step 5 (Test VI.vi) underneath the cRIO-9074 target as illustrated in Figure 6. You need to change the IP of the NI 9148 in the LabVIEW project to the new IP you gave it. Do this by selecting the NI 9148 in the project, right-click, and navigate to Properties. In the configuration window, you can change the IP under General » IP Address/DNS name.

Figure 6.bmp

Figure 7. Project With cRIO-9074

7. When you run Test VI.vi under its new target—the cRIO-9074—you will receive the error shown in Figure 7. This error states that you do not have Scan Mode installed on the NI 9148, but you already installed Scan Mode. The reason for the error is because you switched the IP address of the NI 9148. The static node used in Figure 4 maintains the original IP assigned to the NI 9148. Because you changed the IP to a different subnet, you must change your code to use the Programmatic Shared Variable API. Using the code shown in Figure 8, you can now communicate with your Ethernet RIO expansion chassis.

Figure 7.bmp

Figure 8. Requires Scan Mode

8. To set up the VI in Figure 8 correctly, you need to use the correct Shared Variable API VI. This example uses the Read Variable with Timeout by navigating to Data Communication » Shared Variable » PSP Variable » Read Variable with Timeout in the Functions Pallet.

Figure 8.bmp

Figure 9. Block Diagram for Shared Variable API

Congratulations! You have now successfully connected your Ethernet RIO expansion chassis to the secondary port on your real-time controller.

Next Steps

Browse Ethernet RIO products

Learn more about Ethernet RIO

 

0 Ratings | 0.00 out of 5
Read in  |  Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).