Xcell Journal Online
  Xcell Journal Archives
   
  Writing for Xcell
  Advertising in Xcell
  FREE Subscription
   
  Partner Yellow Pages
  Reference Pages
  Contact Us

    

Home : Documentation : Xcell Journal Online : Article
Building High-Performance Measurement and Control Systems with FPGAs



by Mike Trimborn, LabVIEW Embedded Product Manager, National Instruments
mike.trimborn@ni.com (4/18/05)


National Instruments has customized off-the-shelf FPGA hardware using graphical development tools.
article link to PDF
Article PDF 245 KB


For more than 27 years, National Instruments (NI) has leveraged industry-standard computers, the Internet, and cutting-edge technology to help engineers and scientists build test, measurement, and control solutions. We are a pioneer and leader in virtual instrumentation – a concept that has changed the way engineers and scientists approach measurement and control.

Virtual instrumentation increases productivity and lowers costs through easy-tointegrate software, such as the NI LabVIEW graphical development environment; and modular hardware, such as PCI and PXI modules for data acquisition, instrument control, and machine vision. NI and Xilinx® have collaborated to take virtual instrumentation one step further by bringing the flexibility and performance of FPGAs to measurement and control I/O.

NI LabVIEW for Virtual Instrumentation Virtual instrumentation merges software tools with modular hardware to bring you flexible, programmable, and configurable instrumentation. These systems provide you with user-defined I/O functionality, speed, and resolution not available from traditional “box” instrumentation.

When implemented with high-end modular instrumentation and LabVIEW graphical programming, virtual instrumentation costs less and performs better than other commercial off-the-shelf (COTS) solutions.

The NI LabVIEW FPGA module extends the capabilities of LabVIEW software to target FPGAs on NI-Reconfigurable I/O (RIO) hardware. LabVIEW FPGA and RIO hardware devices bring custom timing, triggering, synchronization, and advanced counter I/O to instrumentation end users (Figure 1). Within the constraints of a COTS hardware platform, LabVIEW provides a highlevel application programming interface (API) for software-to-hardware and hardware-to-hardware interconnections so that you don’t need to generate your own customized API. With NI LabVIEW and RIO hardware, you can rapidly define custom control logic and I/O lines in a LabVIEW program – called a virtual instrument (VI) – without prior knowledge of low-level development tools. Simply draw your hardware design in LabVIEW and the tool chain synthesizes the gates directly into the Xilinx FPGA (Figure 2).

The intuitive graphical nature of LabVIEW also makes it a unique tool for prototyping Xilinx FPGA designs. You can iteratively change your design blocks in LabVIEW and see these changes quickly converted into actual FPGA behavior. Additionally, you can integrate previously developed VHDL or Verilog code within the LabVIEW block diagram using an HDL input node. Using the HDL input node, you can develop low-level algorithms in HDL and represent that algorithm as a single function block within the LabVIEW environment. This function block can be reused throughout the application or saved for other designs.

LabVIEW also provides a thin driverlevel API to interface RIO hardware to the rest of a measurement and control system, simplifying driver development. Therefore, you can easily integrate existing instrumentation, motion, vision, or other COTS hardware into one complete system.

Xilinx FPGAs for Virtual Instrumentation
Several measurement and control instrumentation vendors already use FPGAs because of their performance, fast development time (when compared to other processing technologies), and vendor reconfigurability.

However, until recently, this functionality has been out of reach for many instrumentation users. Most of the growth experienced by Xilinx FPGAs in the measurement and control industry has been among instrumentation vendors rather than their customers.

NI has taken the next logical step – bringing FPGA technology to instrumentation users – by using Xilinx Virtex™-II FPGAs on NI RIO hardware to merge LabVIEW’s rapid development time with the performance and flexibility of Virtex-II devices (Figure 3).

An obstacle LabVIEW overcomes is that HDL software knowledge, while common among hardware designers, is not as popular among measurement and control users who need flexible architectures for custom I/O, timing, and control logic. Chip-to-chip interconnects require knowledge of low-level timing and communication protocols between components. Furthermore, software and hardware systems often require the design of low-level drivers and APIs to interface a custom FPGA board to the rest of a measurement and control system.

This requirement forces you away from the GUI approach used for most other tasks. Such a cumbersome custom development can require weeks or months and cost in excess of $100,000. With the combined usage of LabVIEW and Virtex-II FPGAs, you can successfully avoid these delays and extra costs.

Another consideration is that typical NI data-acquisition products address a broad range of built-in functionality for timing, triggering, and advanced I/O handling (synchronization and event counting). However, in some applications the timing model or built-in functionality breaks down. In these cases, providing hardware with a user-programmable Virtex-II FPGA becomes advantageous because you can define the device to serve the specific needs of your system and application.

With NI RIO hardware, you also save time and money. Rather than building multiple boards for different applications, you can reduce costs by using only one device and reprogram it for different application needs.

Additionally, because code execution is implemented within the Virtex-II device, the hardware responds faster than software, which is very beneficial in applications requiring high-speed control and tight triggering and synchronization. When implementing control loops within Virtex-II devices, digital loops can run up to 20 MHz and analog loops up to 125 kHz. These rates are not achievable in implementations using only system-level software.

Implementation of LabVIEW FPGA
One of our key objectives during the implementation of LabVIEW FPGA was to preserve the same semantics, level of abstraction, and ease of use between the hardware implementation using LabVIEW FPGA and the desktop version of LabVIEW running on Windows. This allows us to leverage the development skills of our existing LabVIEW developers and migrate code between targets. Furthermore, because LabVIEW has always been a parallel language and was originally designed with programming hardware in mind, its parallelism is an ideal match for programming parallel FPGA hardware.

To implement a LabVIEW block diagram onto the FPGA, we generate a set of state machines (in addition to the functionality described in the blocks of the diagram) that behave as an “enable chain” to control the flow of data. We also make data from the LabVIEW FPGA VI available to external programmers very intuitively by representing this data as controls and indicators on the front panel. You can treat the VI running on the FPGA just as if it were a VI on any other processing engine. We then provide a small set of functions to access the LabVIEW FPGA data from a LabVIEW host VI (Figure 4).

To speed up development and take advantage of Xilinx compiler tools, we decided to generate an intermediate netlist representation from the LabVIEW block diagram in a hardware description language, in our case VHDL. This allows us to represent some control logic at higher levels of abstraction, which speeds up the development of our code generators and makes debugging much easier. And because LabVIEW is a very generic programming environment for the host, we developed the module generators themselves in LabVIEW, enabing us to increase our productivity even further.

Once we had met the objectives of creating identical semantics between LabVIEW implemented on a FPGA and LabVIEW implemented on other processing engines, we turned our attention to enhancing the language constructs to take further advantage of the fact that we are running native on hardware. We optimized our timing with single-cycle timed loops, as the strict use of the enable chain had forced us to have a cycle delay for each function. Using the single-cycle timed loop, we can execute complete loops within one FPGA clock cycle. Customers can also integrate legacy VHDL or Verilog code.

Automotive Application
NI alliance partner GÖPEL Electronic, a leading German PCB and electronic device testing company, created a portable measuring unit for onboard vehicle analysis and diagnostics. They used LabVIEW FPGA and CompactRIO, the latest member of the RIO hardware family, to create a portable, rugged, and extremely versatile handheld data recorder for use in test drives in laboratories, environmental chambers, wind tunnels, and on proving grounds. The system, called CARLOS (in- CAR LOgging System), is also ideal for endurance and long-term tests, as well as vehicle calibration and diagnostics.

With CARLOS, you can easily and single-handedly navigate all device functions with a jog wheel, buttons, and soft keys. Several project functions embedded in CARLOS help you manage various measuring units simultaneously. Because the system is based on LabVIEW and Virtex-II FPGA technology, you can reconfigure its functionalities far beyond its factory settings to meet a wide variety of testing needs.

Conclusion
Xilinx and NI have collaborated to help measurement and control engineers build high-performance, custom I/O devices leveraging flexible off-the-shelf hardware powered by Xilinx FPGAs at a considerable cost and time savings. While LabVIEW can be used to define FPGAs quickly, the use of Xilinx Virtex-II FPGAs provides reconfigurable customization for many measurement and control platforms from NI.

Within hours, you can turn an off-theshelf I/O board into a control device that exactly meets your needs without ever knowing VHDL or other low-level hardware design tools. By simply changing the block diagram of the LabVIEW FPGA code, you can recreate hardware with a completely different personality and functionality. This rapidly implemented, reconfigurable I/O approach is unprecedented in the measurement and control industry and continues to expand the capabilities of virtual instrumentation. For more information about LabVIEW FPGA, please visit www.ni.com/fpga/.

Printable PDF version of this article with graphics. PDF logo (4/18/05) 245 KB

 
Jobs Events Webcasts News Investors Feedback Legal Privacy Trademarks Sitemap
© 1994-2008 Xilinx, Inc. All Rights Reserved.