Labview Fpga Module
Labview Fpga Module
Labview Fpga Module
Figure 1 shows an example of a custom counter and period Software Structures in Hardware
measurement application developed in LabVIEW and downloaded to a
RIO device. The upper loop increments a 16-bit counter for every falling Each Single-Cycle Timed Loop in Figure 1 controls the placement of
edge from DI 0 (digital line 0 configured for input), makes the count value registers in the FPGA. The terminals on the left and right sides of each
available for the host application, and generates a digital pulse on DO 1 Single-Cycle Timed Loop represent registered data on the FPGA and pass
(digital line 1 configured for output) every four falling edges. The lower the data value from one loop iteration to the next. Each control and
loop implements a period measurement by measuring the number of indicator on the front panel of the embedded VI, in this case the
clock cycles between rising edges detected on a digital input line. The indicators labeled “Count” and “Period,” are also implemented as
resolution of the measurement is determined by the loop rate. registers in the FPGA; however, these registers are used to pass data to
The Single-Cycle Timed Loop structure that encloses the custom a host application. Finally, the DI and DO terminals read data directly
counter and period measurement code is a special implementation of from the FPGA I/O block.
the LabVIEW Timed Loop and iterates every FPGA clock cycle. In Figure 1, Parallel Execution
the block diagram includes a false Boolean constant so the loop runs
continuously. The clock rate of the counter is determined by the FPGA LabVIEW graphical programming is the ideal way to represent the
clock rate at compile time; the default is 40 MHz. For this application, parallelism of FPGA hardware. Compiled LabVIEW FPGA code is
both loops execute simultaneously at 40 MHz. The code generated by implemented in hardware by configuring logic cell resources on the
the Single-Cycle Timed Loop is also more space-efficient, using fewer FPGA. Independent sections of code, such as parallel loops, are
gates on the FPGA than LabVIEW code defined with a traditional implemented as independent sections of the FPGA. After the chip
While Loop. is configured, data is clocked through the device at a rate specified
Finally, you can integrate existing VHDL IP cores, such as by the onboard clock, executing independent areas of the chip
communication protocols or filter cores, into a LabVIEW FPGA block simultaneously. Figure 1 illustrates how the parallelism of LabVIEW
diagram using the HDL Interface Node. FPGA enables the loops to execute simultaneously without competing
for execution resources.
System Architectures
With the LabVIEW FPGA Module, you develop LabVIEW FPGA programs
on a Windows development system. Then LabVIEW compiles the code
for FPGA synthesis on the NI RIO device. Once downloaded to the target,
the embedded LabVIEW FPGA VI can execute in one of the following
three different configurations:
• Autonomously, where the FPGA device runs independently of
other systems
• Combined with a PC running LabVIEW for Windows, where data
transfers from the FPGA device to the PC for off-line floating-point
analysis, networking, file I/O, or graphical user interface display
• Combined with a LabVIEW Real-Time system, where data is
transferred from the FPGA device to a dedicated processor running
a real-time OS
The LabVIEW Real-Time system provides a deterministic processing
engine for functions performed synchronously or asynchronously to
the FPGA. For example, floating-point arithmetic, including FFTs, PID
calculations, and custom control algorithms, are often performed in
Figure 1. LabVIEW FPGA Block Diagram of a Custom Counter and
Period Measurement Application the LabVIEW Real-Time environment. You can store relevant data on
a LabVIEW Real-Time system or transfer it to a LabVIEW for Windows
host machine for off-line analysis, data logging, or user interface
displays. This configuration is shown in Figure 2.
2
Creating Custom Hardware with LabVIEW
Debugging Tools
Depending on the complexity of your code and the specifications of
your development system, compile time for an FPGA VI can range from
minutes to several hours. To maximize development productivity, the
LabVIEW FPGA Module includes a bit-accurate emulation mode for
R Series devices so you can verify the logic of your design before
initiating the compile process. While targeted to the FPGA emulator,
LabVIEW accesses I/O from the device and executes the VI logic on the
Figure 2. LabVIEW FPGA Architecture with LabVIEW Real-Time and Windows Host PC Windows machine. In this mode, you can use the same debugging tools
available in LabVIEW for Windows, such as execution highlighting,
From a LabVIEW Real-Time or LabVIEW for Windows application, you probes, and breakpoints.
can easily access data in the FPGA registers, represented as controls and
indicators on the LabVIEW FPGA VI, using the FPGA host interface. With
the FPGA interface, a LabVIEW Real-Time or Windows application can
acknowledge and clear interrupts generated in RIO hardware for Create Emulate on Compile Create
FPGA VI PC to test to FPGA Host VI
single-point data or stream data from the FPGA device using DMA.
Figure 3 shows a basic FPGA VI and its corresponding host VI.
LabVIEW FPGA VI
Figure 4. LabVIEW FPGA Application Development Flow
3
Creating Custom Hardware with LabVIEW
4
NI Services and Support
NI has the services and support to meet Software Service Programs
your needs around the globe and through
the application life cycle – from planning NI offers service programs that provide automatic upgrades to your
SERVICE and development through deployment application development environment and higher levels of technical
NEEDS support. Our service programs ensure that you always have the latest
and ongoing maintenance. We offer
services and service levels to meet advances in productivity and receive live, on-demand access to NI
customer requirements in research, applications engineers through phone and e-mail to assist in developing
design, validation, and manufacturing. your solutions. Service programs are cost effective and simplify software
Visit ni.com/services. purchasing as an annual, fixed cost, making it easier to plan and budget
than intermittent individual upgrades. You also receive discounts for our
Local Sales and Technical Support training courses and materials. For details, visit ni.com/ssp.
In offices worldwide, our staff is local to the country, giving you access Basic Service Level
to engineers who speak your language. NI delivers industry-leading • Upgrades purchased separately
technical support through online knowledge bases, our applications • Support by NI applications engineers, R&D engineers, partners, and
engineers, and access to 14,000 measurement and automation community members through online Developer Exchange
professionals within NI Developer Exchange forums. Find immediate • Access to KnowledgeBase, example code, troubleshooting wizards,
answers to your questions at ni.com/support. solutions, and white papers
Training and Certification Standard Service Level
NI training is the fastest, most certain route to productivity with our • Automatic upgrades included
tools. NI training can shorten your learning curve, save development • All the benefits of Basic Service
time, and reduce maintenance costs over the application life cycle. We • Support by NI applications engineers through direct phone or
schedule instructor-led courses in cities worldwide, or we can hold a e-mail access
course at your facility. We also offer a professional certification program • Exclusive access to on-demand training through Services Resource Center
that identifies individuals who
have high levels of skill and Premier Service Level
knowledge on using NI products. • All the benefits of Standard Service
Visit ni.com/training. • Support by NI senior applications engineers through direct phone or
e-mail access with extended hours of operation
Professional Services
Our Professional Services Team is comprised of NI applications
engineers, NI Consulting Services, and a worldwide National
Instruments Alliance Partner program of more than 600 independent
consultants and integrators. Services range from start-up assistance to
turnkey system integration. Visit ni.com/alliance.
© 2005 National Instruments Corporation. All rights reserved. CompactRIO, LabVIEW, National Instruments, National Instruments Alliance Partner, NI, and
ni.com are trademarks of National Instruments. Other product and company names listed are trademarks or trade names of their respective companies.
A National Instruments Alliance Partner is a business entity independent from NI and has no agency, partnership, or joint-venture relationship with NI. 2005-5696-821-101-D