6504 Bridge Point Parkway
Austin, TX 78730-5039
(512) 794-0100
Technical support fax: (800) 328-2203
(512) 794-5678
Branch Offices:
Australia (03) 879 9422, Austria (0662) 435986, Belgium 02/757.00.20, Canada (Ontario) (519) 622-9310,
Canada (Québec) (514) 694-8521, Denmark 45 76 26 00, Finland (90) 527 2321, France (1) 48 14 24 24,
Germany 089/741 31 30, Italy 02/48301892, Japan (03) 3788-1921, Netherlands 03480-33466, Norway 32-848400,
Spain (91) 640 0085, Sweden 08-730 49 70, Switzerland 056/20 51 51, U.K. 0635 523545
Limited Warranty
The media on which you receive National Instruments software are warranted not to fail to execute programming
instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as
evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software
media that do not execute programming instructions if National Instruments receives notice of such defects during
the warranty period. National Instruments does not warrant that the operation of the software shall be uninterrupted
or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the
outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the
shipping costs of returning to the owner parts which are covered by warranty.
National Instruments believes that the information in this manual is accurate. The document has been carefully
reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments
reserves the right to make changes to subsequent editions of this document without prior notice to holders of this
edition. The reader should consult National Instruments if errors are suspected. In no event shall National
Instruments be liable for any damages arising out of or related to this document or the information contained in it.
EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE
OF
NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS,
USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY
THEREOF
whether in contract or tort, including negligence. Any action against National Instruments must be brought within
one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due
to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects,
malfunctions, or service failures caused by owner's failure to follow the National Instruments installation, operation,
or maintenance instructions; owner's modification of the product; owner's abuse, misuse, or negligent acts; and
power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control.
. CUSTOMER'S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART
NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER.
. This limitation of the liability of National Instruments will apply regardless of the form of action,
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or
mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or
in part, without the prior written consent of National Instruments Corporation.
Trademarks
LabVIEW®, NI-DAQ®, RTSI®, and NI-DSP™ are trademarks of National Instruments Corporation.
Product and company names listed are trademarks or trade names of their respective companies.
Warning Regarding Medical and Clinical Use
of National Instruments Products
National Instruments products are not designed with components and testing intended to ensure a level of reliability
suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving
medical or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the
part of the user or application designer. Any use or application of National Instruments products for or involving
medical or clinical treatment must be performed by properly trained and qualified medical personnel, and all
traditional medical safeguards, equipment, and procedures that are appropriate in the particular situation to prevent
serious injury or death should always continue to be used when National Instruments products are being used.
National Instruments products are NOT intended to be a substitute for any form of established process, procedure, or
equipment used to monitor or safeguard human health and safety in medical or clinical treatment.
Contents
About This Manual.................................................................................................................... xi
Assumption of Previous Knowledge ........................................................................................................ xi
Organization of This Manual.................................................................................................................... xi
Conventions Used in This Manual............................................................................................................ xii
Related Documentation ............................................................................................................................ xiv
Additional Software.................................................................................................................................. xiv
NI-DAQ for DOS/Windows/LabWindows ................................................................................ xiv
Developer Toolkit ...................................................................................................................... xv
Compatible Hardware............................................................................................................................... xv
Customer Communication ........................................................................................................................ xv
Memory Management and Data Transfer................................................................................................. 1-2
Special Features of the NI-DSP Analysis VIs .......................................................................................... 1-5
Hints for Improving the Execution Speed on the DSP Board.................................................... 1-7
An Example of Using NI-DSP Analysis VIs............................................................................................ 1-8
Part 3
NI-DSP Function Reference
Chapter 1
NI-DSP Analysis VI Reference Overview
The NI-DSP Analysis VI Overview ......................................................................................................... 1-1
Analysis VI Organization ......................................................................................................................... 1-3
Accessing the NI-DSP Analysis VIs ........................................................................................................ 1-3
About the Fast Fourier Transform (FFT).................................................................................................. 1-4
About Filtering.......................................................................................................................................... 1-5
About Windowing .................................................................................................................................... 1-6
DSP Flat Top Window.............................................................................................................................. 2-33
DSP Force Window .................................................................................................................................. 2-34
DSP Index Memory .................................................................................................................................. 2-44
DSP Linear Evaluation ............................................................................................................................. 2-51
DSP Max & Min....................................................................................................................................... 2-53
DSP Median Filter .................................................................................................................................... 2-54
DSP Power Spectrum................................................................................................................................ 2-61
DSP Random Pattern ................................................................................................................................ 2-64
DSP Rectangular to Polar ......................................................................................................................... 2-65
DSP Sine Pattern....................................................................................................................................... 2-71
DSP Zero Padder ...................................................................................................................................... 2-84
Part 4
NI-DSP Interface Utilities
Chapter 1
Introduction to the NI-DSP Interface Utilities
Overview of the NI-DSP Interface Utilities.............................................................................................. 1-1
Installing the NI-DSP Interface Utilities .................................................................................................. 1-2
Using the NI-DSP Interface Utilities ........................................................................................................ 1-2
Chapter 2
Getting Started with the NI-DSP Interface Utilities
Creating Your Custom NI-DSP Library................................................................................................... 2-1
1. Create Your Source Code of C Functions............................................................................. 2-1
The NI-DSP Software ReferenceManual for LabVIEW for Windows explains how to use the NI-DSP software
package for the LabVIEW for Windows environment. The NI-DSP software package contains the NI-DSP Analysis
VIs, which are high-level digital signal processing (DSP) VIs that call the functions that execute on the
AT-DSP2200 plug-in board for IBM AT bus and compatible computers. This manual describes how to use the
NI-DSP Analysis VIs to develop applications in LabVIEW using the AT-DSP2200 board.
The NI-DSP software package also contains the NI-DSP Interface Utilities. The NI-DSP Interface Utilities are a set
of tools and examples that help you customize your NI-DSP Analysis VIs and the DSP Library, which is resident on
the board. This manual contains step-by-step instructions and useful examples to help the LabVIEW developer add
custom algorithms to the NI-DSP Analysis VIs using the NI-DSP Interface Utilities.
Assumption of Previous Knowledge
The material in this manual is for users who are familiar with LabVIEW and the IBM family of computers and
compatible computers.
Organization of This Manual
This manual is divided into four parts.
•Part 1, Getting Started with NI-DSP, contains a brief product overview, information about the NI-DSP for
LabVIEW for Windows package, and the procedure for installing the software.
•Part 2, Introduction to the NI-DSP Analysis VIs, describes how to use the NI-DSP Analysis VIs in your
LabVIEW applications. This part also describes how to manage memory on the DSP board from your
LabVIEW application, and how to transfer data between your LabVIEW application and the NI-DSP functions
on the board. This part contains general guidelines for developing NI-DSP applications within LabVIEW.
•Part 3, NI-DSP Function Reference, is intended as a reference for users familiar with Part 2. Part 3 is organized
as follows:
-Chapter 1, NI-DSP Analysis VI Reference Overview, contains an overview of the NI-DSP Analysis VIs and
includes a list of the VIs. This chapter describes how the NI-DSP Analysis VIs are organized, and how to
access them.
-Chapter 2, NI-DSP Analysis VI Reference, contains a brief explanation of each NI-DSP Analysis VI. The
VIs are arranged alphabetically.
•Part 4, NI-DSP Interface Utilities, explains how to customize the NI-DSP Analysis Library on the board and to
create and run interfaces in LabVIEW to your custom library functions. Part 4 is organized as follows:
-Chapter 1, Introductionto the NI-DSP Interface Utilities, contains an overview of the NI-DSP Interface
Utilities, installation instructions, and explains how to use the NI-DSP Interface Utilities.
-Chapter 2, Getting Started with the NI-DSP Interface Utilities, contains a step-by-step example for building
a custom DSP Library, creating a LabVIEW interface to a custom function, and executing the custom
function from the LabVIEW environment. The chapter demonstrates this concept with an example of how
to add a custom function.
-Chapter 3, DSP Board Function Overview, contains an overview of the prototypes of the C-callable
NI-DSP Analysis functions on the DSP board that you can use in your custom programs.
-Chapter 4, Using the DMA VIs, describes two special VIs that transfer data between the host computer and
the DSP board without interfering with the DSP board.
•Appendix A, Error Codes, contains a list of the error codes returned by the NI-DSP Analysis VIs and the
corresponding error messages.
•Appendix B, Customer Communication, contains forms you can use to request help from National Instruments
or to comment on our products and manuals.
•The Glossary contains an alphabetical list and description of terms used in this manual, including abbreviations,
acronyms, metric prefixes, mnemonics, and symbols.
•The Index alphabetically lists topics covered in this manual, including the page where the topic can be found.
Conventions Used in This Manual
The following conventions are used in this manual:
<>Angle brackets enclose the name of a key on the keyboard–for example, <enter>.
boldBold text denotes menus, command names, parameters, function panel items, error
messages, and warnings.
DSP boardDSP board refers to the AT-DSP2200.
DSP HandleDSP Handle refers to a 32-bit long integer code that constitutes an indirect reference to a
buffer of memory in the memory space of an AT-DSP2200 board. The code contains
information about the slot number of the board on which that buffer is allocated.
DSP Handle ClusterDSP Handle Cluster refers to a cluster that constitutes two fields–a DSP Handle and a
32-bit size that indicates the number of elements the DSP Handle holds.
DSP LibraryDSP Library refers to a common object file format (COFF) that constitutes NI-DSP
software that resides and runs on the AT-DSP2200 board. The DSP Library consists of
the Kernel, memory management routines, execution control routines, data
communication routines, interrupt handling routines, data acquisition routines and a set of
analysis functions.
<enter>Key names are in lowercase letters.
Interface LibraryInterface Library refers to the part of the NI-DSP software that resides on the PC and is
linked with your application in order to communicate data to and from the DSP board.
The Interface Library communicates with the DSP board using the driver.
italicItalic text denotes emphasis, a cross reference, or an introduction to a key concept.
italic monospace
Italic text in this font denotes that you must supply the appropriate words or values in the
LabVIEW Data TypesEach VI description includes a data type picture for each control and indicator, as
illustrated in the following table:
ControlIndicatorData Type
Boolean
String
Signed 16-bit integer
Array of signed 16-bit integers
Signed 32-bit integer
Array of signed 32-bit integers
32-bit floating-point number; by default,
floating-point numbers are double precision
Array of 32-bit floating-point numbers
Path
DSP Handle Cluster
Array of DSP Handle Clusters
Error Cluster
monospaceText in this font denotes text or characters that are to be literally input from the keyboard,
sections of code, programming examples, and syntax examples. This font is also used for
the proper names of disk drives, paths, directories, programs, subprograms, subroutines,
device names, array names, structures, variables, filenames, and extensions, and for
statements and comments taken from program code.
NI-DAQNI-DAQ is used throughout this manual to refer to the NI-DAQ software for
DOS/Windows/LabWindows unless otherwise noted.
NI-DSPNI-DSP is used throughout this manual to refer to the NI-DSP software for LabVIEW for
Windows unless otherwise noted.
PCPC refers to the IBM PC AT and compatible computers, and to EISA personal computers.
WE DSP32C toolsWE DSP32C tools is used throughout this manual to refer to the AT&T WE DSP32C
Developer Toolkit.
Abbreviations, acronyms, metric prefixes, mnemonics, symbols, and terms are listed in the Glossary.
The following documentation available from National Instruments contains information that you may find helpful as
you read this manual.
•AT-DSP2200 User Manual, part number 320435-01
•LabVIEW Data Acquisition VI Reference Manual, part number 320536-01
•LabVIEW Getting Started Manual for Windows, part number 320533-01
•LabVIEW User Manual, part number 320534-01
•LabVIEW Utility VI Reference Manual, part number 320543-01
•NI-DAQ Function Reference Manual for DOS/Windows/LabWindows, part number 320499-01
•NI-DAQ Software Reference Manual for DOS/Windows/LabWindows, part number 320498-01
•NI-DSP Software Reference Manual for DOS/LabWindows, part number 320436-01
The following documentation also contains information that you may find helpful as you read this manual:
•"A Computer Program for Designing Optimum FIR Linear Phase Digital Filters," McClellan, Parks, and
Rabiner, IEEE Transactions on Audio and Electroacoustics, Vol. AU-21, No. 6, pp. 506-525, December 1973
•Digital Filter Design, Parks and Burrus, Wiley-Interscience
•Discrete-Time Signal Processing, Oppenheim and Schafer, Prentice Hall
•Numerical Recipes, Cambridge University Press
Additional Software
Additional DSP board software includes NI-DAQ for DOS/Windows/LabWindows and the Developer Toolkit.
NI-DAQ for DOS/Windows/LabWindows
Your AT-DSP2200 is shipped with the NI-DAQ for DOS/Windows/LabWindows software. NI-DAQ has a library
of functions that can be called from your application programming environment. These functions include routines
for analog input (A/D conversion), buffered data acquisition (high-speed A/D conversion), analog output (D/A
conversion), waveform generation, digital I/O, counter/timer, SCXI, RTSI, and self-calibration. NI-DAQ maintains
a consistent software interface among its different versions so you can switch between platforms with minimal
modifications to your code. NI-DAQ comes with language interfaces for Professional BASIC, Turbo Pascal,
Turbo C, Turbo C++, Borland C++, Microsoft C for DOS; and Visual Basic, Pascal, Microsoft C with SDK, and
Borland C++ for Windows. NI-DAQ for DOS/Windows/LabWindows software is on high-density 5.25 in. and
3.5 in. diskettes. You can use the DSP board in conjunction with the National Instruments AT Series data
acquisition boards and software to create a complete solution for integrated data acquisition and data analysis
applications.
The Developer Toolkit, an optional software package that you can purchase separately from National Instruments, is
required for building custom libraries with the NI-DSP Interface Utilities. The Developer Toolkit contains an
AT&T C compiler, assembler, linker, and documentation. With these tools, you can program AT Series DSP boards
directly, using theboard flexibility to custom tailor the DSP Library. The C compiler optimizes WE DSP32C code
and generates assembly language code that can be assembled and linked into a run-time module. When a run-time
module is completed, use the download tools and the debugger to load, debug, and execute the code, set parameters,
and report results. The Developer Toolkit also includes the WE DSP32C Support Software Library User Manual
and the WE DSP32 and WE DSP32C Language Compiler Library Reference Manual.
Compatible Hardware
You can use DSP boards in conjunction with the National Instruments AT Series data acquisition boards. In
particular, the National Instruments AT-DSP2200 is a high-performance, DSP board with high-accuracy audio
frequency (DC to 51.2 kHz) analog input/output for the PC. The AT-DSP2200 gives the PC a dedicated
high-speed numerical computation engine that can perform scientific calculations faster than the general-purpose
80x86 microprocessor on the PC.
Customer Communication
National Instruments wants to receive your comments on our products and manuals. We are interested in the
applications you develop with our products, and we want to help if you have problems with them. To make it easy
for you to contact us, this manual contains comment and configuration forms for you to complete. These forms are
in Appendix B, Customer Communication, at the end of this manual.
This part contains a brief product overview, information about the NI-DSP for LabVIEW for Windows package, and
the procedure for installing the software.
Product Overview
The NI-DSP software package comes with a set of LabVIEW VIs that invoke the digital signal processing (DSP)
board-resident high-performance functions that efficiently process large blocks of numerical data and perform
numerically intensive computations. The NI-DSP Analysis VIs include numerical analysis, signal generation, DSP,
windowing, digital filtering, and memory management that are suitable for simulation, modeling, and sophisticated
data processing.
You can use NI-DSP to develop programs in the LabVIEW for Windows environment. This software comes with
the NI-DSP Interface Utilities so you can customize the DSP Library by adding functions to or deleting functions
from the Analysis Library on the DSP board and/or add interfaces to these custom functions in LabVIEW.
Figure 1-1 shows the development path for NI-DSP in the LabVIEW environment.
NI-DSP for
The LabVIEW
for Windows
Development
Environment
AT&T
Development
Environment
and T ools
(Optional)
Figure 1-1. Development Paths with the NI-DSP Software
LabVIEW
for Windows
Interface
Utilities
The NI-DSP Software
The NI-DSP software consists of the NI-DSP for LabVIEW for Windows diskettes.
User
Application
The NI-DSP software contains a Warranty Registration Form. Please fill out this form and return it to National
Instruments. The Warranty Registration Form entitles you to receive product upgrades and technical support.
NI-DSP SRM for LabVIEW for Windows1-1Part 1: Getting Started with NI-DSP
Getting Started with NI-DSPPart 1
What Your Distribution Diskettes Should Contain
The NI-DSP software package contains the NI-DSP for LabVIEW for Windows Disks (for licensed LabVIEW for
Windows users). If your kit is missing any of these components, contact National Instruments.
Installing NI-DSP for LabVIEW for Windows
Note:NI-DSP for LabVIEW for Windows is intended for use with the standard LabVIEW for Windows software.
You must install LabVIEW for Windows before installing NI-DSP. You must install the Data Acquisition
Library of LabVIEW to run the NI-DSP software.
Before beginning the software installation, make backup copies of the NI-DSP for LabVIEW for Windows
distribution disks. Copy each disk onto a correctly labeled backup disk and store the original distribution disks in a
safe place.
You can install NI-DSP for LabVIEW for Windows from the DOS prompt, the Windows File Manager, or with the
Run... command from the File menu of the Program Manager.
1.Insert Disk 1 into the disk drive and run the SETUP.EXE program on Disk 1 using one of the following three
methods.
•From the DOS prompt, type X: \SETUP (where X is the proper drive designation).
•From Windows, select Run... from the File menu of the Program Manager. A dialog box appears. Type
X: \SETUP (where X is the proper drive designation).
•From Windows, launch the File Manager. Click on the drive icon that contains Disk 1. Find SETUP.EXE
in the list of files on that disk and double-click on it.
2.The installer gives you the option of performing a full installation or a custom installation. Unless you do not
have sufficient disk space (approximately 4 megabytes), National Instruments recommends that you perform a
full installation. After you choose an installation, follow the instructions that appear on the screen.
After calling SETUP, the appropriate directories are created and the needed files are copied to your hard drive.
SETUP can also install the NI-DSP Interface Utilities, discussed in Part 4, NI-DSP Interface Utilities, of this manual.
If you choose Full Installation, SETUP does the following things:
1.SETUP creates a subdirectory called DSP2200 of the vi.lib subdirectory of the LabVIEW directory.
SETUP decompresses the NI-DSP Analysis VIs (as LabVIEW .LLB files) in the DSP2200 directory.
2.SETUP copies DSP.DLL to your windows directory.
3.SETUP creates the subdirectories shown in Table 1-1 under the directory you specified during setup. These
subdirectories make up the NI-DSP Interface Utilities.
4.SETUP creates a subdirectory called DSP2200 of the EXAMPLES subdirectory of the LabVIEW directory.
SETUP copies all of the NI-DSP VI examples there.
Table 1-1. Subdirectories Created by SETUP
Subdirectory NameDescription
C:\NIDSP\LIBLibrary files for linking with stand-alone programs
C:\NIDSP\DISPATCHThe Dispatch utility and related files
C:\NIDSP\EXAMPLESContains source code for the examples
Part 1: Getting Started with NI-DSP1-2NI-DSP SRM for LabVIEW for Windows
Part 1Getting Started with NI-DSP
NIDSP is the name you specify during setup.
The SETUP program prompts you for information including the drive letter and directory in which you have
installed the standard LabVIEW package. The program also verifies that your hard disk has enough space to hold
the NI-DSP for LabVIEW for Windows files.
If you choose Custom Installation, SETUP installs only the files you specify.
Board Configuration
There are several board configuration parameters that must be established before an NI-DSP application can execute
properly. These parameters are the board ID number, the board subtype, the base address, the interrupt level, the
DMA channel, and the pathname of the DSP Library files. These parameters are established differently depending
on whether you are installing the AT-DSP2200 in an ISA (or AT) bus computer or an EISA bus computer.
Installation on an ISA (or AT) Bus Computer
A configuration utility is supplied with the LabVIEW data acquisition software for establishing all the configuration
parameters on ISA bus computers. This utility, called WDAQCONF.EXE, saves the configuration parameters in a file
named WDAQCONF.CFG. Use the WDAQCONF utility to assign a board ID number to your AT-DSP2200, to choose
the memory subtype (either 64 Kwords or ≥128 Kwords), to set the base address, interrupt level, and DMA channel,
and to specify the pathname of the DSP Library file.
Two DSP Library files are supplied with your NI-DSP software–LV2200S.OUT and LV2200.OUT.
LV2200S.OUT is intended for use with the 64 Kword version of the AT-DSP2200. LV2200.OUT is intended for
use with any other version of the board. With the WDAQCONF utility, you can enter a complete path that will include
the DSP Library file name. If you enter complete pathnames, you can configure the NI-DSP software to
automatically load custom versions of the DSP Library files.
If you installed the Data Acquisition Library of LabVIEW, you can find WDAQCONF.EXE of your LabVIEW
directory. From Windows, you run WDAQCONF.EXE by double-clicking on its icon.
Installation on an EISA Bus Computer
Installing the AT-DSP2200 board on an EISA bus computer involves two different configuration utilities.
•A system configuration utility is supplied with your computer by your computer vendor. This utility, along with
the !NIC1100.CFG EISA configuration file installed by the LabVIEW SETUP program, is used to assign a
slot number to the AT-DSP2200, to choose the memory subtype (either 64 Kwords or ≥128 Kwords), and to set
the base address, interrupt level, and DMA channel.
There are typically two methods for running your EISA system configuration utility.
1.Boot from the diskette containing the utility and place a copy of the !NIC1100.CFG file on this diskette.
2.Run the utility from a directory on your hard disk and place a copy of the !NIC1100.CFG file in this
directory. The EISA system configuration utility is typically named CF.EXE.
•You must use the WDAQCONF utility to enter the DSP Library file pathname. You can only do this after
completing the EISA system configuration. Refer to the information concerning the establishment of this
pathname in the previous section titled, Installation on an ISA (or AT) Bus Computer.
Before using NI-DSP, you must run WDAQCONF.EXE to configure your DSP board.
For more information about board configuration, refer to Chapter 1, Introduction and Configuration, of the
LabVIEW Data Acquisition VI Reference Manual.
NI-DSP SRM for LabVIEW for Windows1-3Part 1: Getting Started with NI-DSP
Part 2
Introduction to the NI-DSP Analysis VIs
This part describes how to use the NI-DSP Analysis VIs in your LabVIEW applications. This part also describes
how to manage memory on the DSP board from your LabVIEW application, and how to transfer data between your
LabVIEW application and the NI-DSP functions on the board. This part contains general guidelines for developing
NI-DSP applications within LabVIEW.
Using the NI-DSP VIs in LabVIEW
LabVIEW users use the NI-DSP Analysis VIs as if they were any other standard VIs, as described in the LabVIEW
User Manual. Notice, however, that the NI-DSP Analysis VIs run analysis code on the DSP board rather than on the
host CPU. One of the major features includes the memory management and data transfer VIs, which are discussed
in detail in the section titled Memory Management and Data Transfer later in this chapter.
AT-DSP2200 Software Overview
The AT-DSP2200 board, working in conjunction with your personal computer, is a powerful numeric processor for
high-speed analysis of data arrays. The NI-DSP for LabVIEW for Windows software includes a number of utilities
and low-level memory management and data transfer VIs that facilitate communication between the DSP board and
the host computer. Figure 1-1 is a block diagram of the software utilities and libraries that control the
AT-DSP2200. The DSP Library and the low-level memory management and data transfer functions reside and
execute on the board. You can customize the DSP Library to optimize performance, as described in Part 4,
Chapter 2, Getting Started with the NI-DSP Interface Utilities, of this manual. Your application programs and the
Interface Library, however, reside on the host PC.
User
Application
in LabVIEW
VI
Interface
(CIN)
PCAT-DSP2200
Interface
Library
(DSP.DLL)
Figure 1-1. Communication between the PC and the DSP Board
AT or EISA Bus
DSP Software
Onboard Kernel,
DSP Board
Memory
Management,
Data Transfer
Functions
DSP Library
DSP Hardware
CPU
Onboard Memory
NI-DSP SRM for LabVIEW for Windows1-1Part 2: Introduction to the NI-DSP Analysis VIs
Introduction to the NI-DSP Analysis VIsPart 2
The AT-DSP2200 can process large amounts of data, separately and distinctly from the host PC processor. The
board consists not only of a signal processing chip, but also memory where data that the board processes must
reside. The AT-DSP2200 does not have access to memory locations on the host PC. Therefore, you must download
all data from your application programs to DSP board memory before processing it.
The Interface Library, DSP.DLL, and the Code Interface Node (CIN) interface, which reside on the PC, serve as a
bridge between your application programs in LabVIEW and the DSP software running on the board. When you call
an NI-DSP Analysis VI, the VI passes the parameters to the CIN first, which then passes the parameters to the
Interface Library, DSP.DLL. The Interface Library determines what type of parameters are being passed, decides
how to set up the data in DSP board memory, and then calls the actual functions that will run on the board.
When a function on the DSP board processes data, it assumes the data is resident in DSP board memory. Because
transferring data between the PC and the DSP board slows down processing, none of the NI-DSP Analysis VIs
transfer data back and forth internally except the data transferring VIs. The NI-DSP Analysis VIs process the data
buffers that are already on the board and leave the results on the board.
If the data buffer you want to process using the DSP board is in PC memory, you must copy the data to the DSP
board before you call a function on the DSP board to process the data. To see the results, you must then copy the
data back to the PC. Several special NI-DSP Analysis VIs perform these transfers. For scalars, the NI-DSP
Analysis VIs automatically perform the transfer for you.
The representation of data buffers in the NI-DSP Analysis VIs is not the normal LabVIEW data array representation
because the data buffers indicate the data location on the DSP board instead of the PC address. A special structure,
called a DSP Handle Cluster, represents the data buffer on the DSP board from LabVIEW. The DSP Handle Cluster
is a coded DSP board memory address that indicates where the data buffer is on the DSP board. You must call the
DSP Allocate Memory VI to obtain a valid DSP Handle Cluster. Several VIs can manage the memory on the DSP
board. You can allocate and deallocate memory on the DSP board using these VIs. The next section, MemoryManagement and Data Transfer, discusses the VIs used to allocate memory and transfer data buffers to and from the
DSP board.
Memory Management and Data Transfer
This section describes how to manage memory on the DSP board from your LabVIEW application and how to
transfer data between your LabVIEW application and the DSP board.
The NI-DSP for LabVIEW package contains a set of VIs that manage memory space on the DSP board and help
improve data transfers between the DSP board and your application. There are VIs for allocating memory buffers on
the DSP board, for indexing into previously allocated buffers, for deallocating buffers and for copying data between
DSP and LabVIEW. The following VIs, described in greater detail in Part 3 of Chapter 2, NI-DSP Analysis VIReference, handle memory management on the DSP board and data transfers between the DSP board and your
LabVIEW application:
•Copy Mem[DSP to DSP]
•Copy Mem[DSP to LV]
•Copy Mem[LV to DSP]
•DSP Allocate Memory
•DSP Free Memory
•DSP Index Memory
•DSP Init Memory
Part 2: Introduction to the NI-DSP Analysis VIs1-2NI-DSP SRM for LabVIEW for Windows
Part 2Introduction to the NI-DSP Analysis VIs
The DSP Allocate Memory VI allocates memory buffers on the DSP board and returns a DSP Handle Cluster, which
has two fields that uniquely describe this buffer–a DSP Handle and a size.
Figure 1-2. DSP Handle Cluster
DSP Handle is a 32-bit integer containing information that indicates the board on which the allocated buffer resides,
and an index into an onboard Memory Look Up Table (MLUT) that holds the actual DSP address of the buffer that
this handle represents. Figure 1-3 shows how a DSP Handle is encoded. The size field holds the number of
elements in this buffer. An element can be 4 bytes (for 32-bit floating-point data or long integer data) or 2 bytes (for
16-bit integer data) depending on the bytes per element selector used in the DSP Allocate Memory VI.
X XXX 3 0 04
Figure 1-3. The Hexadecimal Encoding of a Typical DSP Handle
The first four hexadecimal numbers (upper 16 bits) of the DSP Handle, shown in Figure 1-3, are a special value.
The interface code for a particular function that your application calls decodes these four hexadecimal numbers to
determine if the argument is a valid DSP Handle.
Notes: Do not change the value of a DSP Handle Cluster. Keep in mind that a DSP Handle Cluster is just an entry
of a table that indicates where the data buffer is on the DSP board. If you want to operate on part of the
data in that buffer, use the DSP Index Memory VI or the DSP Subset VI to obtain a new DSP Handle
Cluster to hold the part of the data. Then operate on the new DSP Handle Cluster.
}
Board Number of
Special Code
Owner DSP Board
}
Index into the
MLUT of the
Owner DSP Board
The Memory Look-Up Table (MLUT) has only 128 entries. You can allocate only a total of 128 different
DSP Handle Clusters. Although you might have physical memory on the DSP board, you will get an error
message for not having enough memory if you already have 128 DSP Handle Clusters in use. Free the DSP
Handle Clusters that are not in use. The DSP Init Memory VI will free all DSP Handle Clusters on the
specified DSP board.
NI-DSP SRM for LabVIEW for Windows1-3Part 2: Introduction to the NI-DSP Analysis VIs
Introduction to the NI-DSP Analysis VIsPart 2
Figures 1-4 and 1-5 show how to allocate a DSP Handle Cluster of 2,048 4-byte-long elements on board 3. The
board number on which the buffer is allocated is important for determining the ownership of the buffer. When
making a VI call, the same DSP board on which the function is to execute must own all of the DSP Handle Clusters
or an error code is returned. Only the DSP Allocate Memory VI and few other VIs that do not have DSP Handle
Clusters as input parameters have a board slot parameter. VIs that have DSP Handle Clusters as input parameters
obtain the board slot information from their own DSP Handle Clusters. All of the DSP Handle Clusters should have
the same slot information, because the DSP VIs assume that all are executing on the same DSP board.
Figure 1-4. Front Panel–An Example of How to Allocate a DSP Handle Cluster
Figure 1-5. Block Diagram–An Example of How to Allocate a DSP Handle Cluster
For all of the NI-DSP Analysis VIs, the array data type is DSP Handle Cluster. Before you call any of these VIs,
call the DSP Allocate Memory VI to obtain a valid DSP Handle Cluster, which you then use as a reference to your
data buffer. The Analysis VIs assume that the data is already on the board and stores the results on the board. If you
want to copy data between the PC and the DSP board, use either the Copy Mem(LV to DSP) VI or the Copy
Mem(DSP to LV) VI to copy data back and forth.
If you use the DSP Allocate Memory VI in your program, use the DSP Free Memory VI to free buffers allocated
when you do not need them any more. The board holds these allocations in memory even after your application has
completed or you exit LabVIEW unless you execute the DSP Init Memory VI or reload the DSP Library. Thus, it is
important to free all buffers your application allocated before you exit the application or you may run out of memory
on the board.
Part 2: Introduction to the NI-DSP Analysis VIs1-4NI-DSP SRM for LabVIEW for Windows
Part 2Introduction to the NI-DSP Analysis VIs
Special Features of the NI-DSP Analysis VIs
This section describes the special features of the NI-DSP Analysis VIs that make them different from other
LabVIEW VIs.
•DSP Handle Cluster in/out. The way you specify the output data buffers for NI-DSP Analysis VIs is different
from the way you would specify output data buffers for other LabVIEW VIs. DSP Handle Clusters also
represent all the output data buffers in the NI-DSP Analysis VIs. To use valid DSP Handle Clusters for the
NI-DSP VI output data buffers, you must use the DSP Allocate Memory VI to obtain the DSP Handle Clusters
before you use them. Supply all of the output DSP Handle Clusters as inputs to tell the DSP board where the
output buffers are. Every output DSP Handle Cluster is identical to the corresponding input DSP Handle
Cluster. The two DSP Handle Clusters are internally connected. The output is an indicator. The input is a
control. For example, in the DSP Add VI, shown in Figure 1-6, Z is the DSP Handle Cluster that indicates
where to store the results. You use Z in to connect to a valid DSP Handle Cluster that you previously allocated.
Zin tells the DSP board where the results will be stored. Zout is the location where the results have already
been stored. Because Z in and Z out are the same DSP Handle Cluster, you need to free only one of them when
you want to deallocate their DSP board buffer.
Figure 1-6. DSP Add VI
All of the controls and indicators in the NI-DSP Analysis VIs follow the Z in, Z out naming convention and
work in the same way as previously described in the example, except for the error in/error out cluster.
•Error Handling. All of the NI-DSP Analysis VIs have an error input and an error output for managing and
reporting errors. The error in/error out cluster used by the NI-DSP VIs and many other high-level I/O
operations is a cluster containing a Boolean indicating whether the data should be treated as an error, a 32-bit
error code, and a descriptive string that usually contains the name of the source of the error. The error in/errorout cluster is shown in Figure 1-7.
Figure 1-7. The error in/error out Cluster
NI-DSP SRM for LabVIEW for Windows1-5Part 2: Introduction to the NI-DSP Analysis VIs
Introduction to the NI-DSP Analysis VIsPart 2
The error in/error out cluster contains the following elements:
The boolean value is true if an error occurred, false if no error occurred.
code is the error code.
source is the source of the error. If an error occurs during execution, the VI sets source to the name
of the VI that produced the error.
Every VI checks error in first. If there is an error, the VI does not execute any DSP code but simply passes the
contents of error in to the error out cluster. If there is no error, the VI executes. One advantage of this errorin/error out design is that you can connect several I/O operations together so that, if an error occurs, subsequent VIs
do not perform undesired actions. DSP Free Memory will execute even if an error occurs. This ensures that
allocated buffers are freed even if an error occurred.
Another advantage of this error in/error out design is that you can establish the order of a set of operations, even if
there is no other data flow between the operations. Connecting the error out of the first VI to the error in of the
second VI establishes data flow and therefore execution order. You could do the same thing with a Sequence
structure, but with the error in/error out design, you can establish the order with all of the operations at the top level
of the block diagram. For example, in Figure 1-8, you allocate DSP Handle Clusters X and Y as inputs, and you want
to free X and Y after the DSP Add VI has been executed. If you simply connect X to the DSP Free Memory VI as
shown in Figure 1-8, there is no sequential order between the DSP Add VI and the DSP Free Memory VI. If the DSP
Free Memory VI executes first, the DSP Add VI will receive an invalid handle because that DSP Handle Cluster was
deallocated.
Figure 1-8. An Example That Does Not Use error in/error out
for Sequencing VIs
If you connect the VIs as shown Figure 1-9 instead, you ensure that the DSP Add VI executes before the DSP Free
Memory VI.
Part 2: Introduction to the NI-DSP Analysis VIs1-6NI-DSP SRM for LabVIEW for Windows
Part 2Introduction to the NI-DSP Analysis VIs
error out of the Copy Mem(LV to DSP) VI is
connected to the error in of the DSP Free
Memory VI
error out of the DSP Add VI is
connected to the error in of the
Copy Mem(LV to DSP) VI
Figure 1-9. An Example of Using the error in/error out Cluster for Sequential VI Execution
For more information about the error in/error out cluster, refer to Chapter 2, Error Handler VIs, in the LabVIEW
Utility VI Reference Manual.
Hints for Improving the Execution Speed on the DSP Board
Check each of the following things to maximize your DSP board performance:
•Allocate as many of the DSP Handle Clusters as you can before you operate on the data. Keep all data on the
DSP board until you finish all of the processing. Reduce the number of data transfers between the DSP board
and the PC as much as possible. The functions that run on the DSP board are very fast, but transferring data
between the DSP board and the PC and memory allocation slows the total processing performance.
•Use the error in/error out cluster for sequencing VI execution. Be sure all of your VIs run in the correct
sequence. Use the error in/error out cluster to propagate the errors. If an error occurs, you can tell where the
error happens. You can use the LabVIEW error handler VIs in the Utility option of the Functions menu to
obtain pop-up error messages. Refer to the LabVIEW Utility VI Reference Manual for more information about
these VIs.
•Many analysis routines on the DSP board can be performed in place; that is, the input and output array can be
the same array. This is very important to remember when you are processing large amounts of data. Large
32-bit floating-point arrays consume a lot of memory. If the results you want do not require that you keep the
original array or an intermediate array of data, perform analysis operations in place whenever possible. For
example, use the same DSP Handle Cluster for the input and output data buffers in your diagram in LabVIEW.
This will save your DSP board memory.
•Several intermediate-level data acquisition VIs work with DSP Handle Clusters. These VIs can acquire data
and leave it on the board. You can use the NI-DSP Analysis VIs to operate on this data and then copy the
processed results back to the PC. In this way, you dramatically reduce the data transfer overhead between the
PC and the DSP board, and improve the overall performance. For more information about these data
acquisition VIs, refer to the LabVIEW Data Acquisition VI Reference Manual. An example that shows you how
to use a DSP Handle Cluster to acquire data and process this data on the DSP board can be found in the
DSP2200 subdirectory of the EXAMPLES subdirectory of your LabVIEW directory.
NI-DSP SRM for LabVIEW for Windows1-7Part 2: Introduction to the NI-DSP Analysis VIs
Introduction to the NI-DSP Analysis VIsPart 2
An Example of Using NI-DSP Analysis VIs
Figures 1-10 and 1-11 show the front panel and block diagram, respectively, of an example using NI-DSP Analysis
VIs.
Figure 1-10. Front Panel–An Example of Using NI-DSP Analysis VIs
Figure 1-11. Block Diagram–An Example of Using NI-DSP Analysis VIs
Part 2: Introduction to the NI-DSP Analysis VIs1-8NI-DSP SRM for LabVIEW for Windows
Part 2Introduction to the NI-DSP Analysis VIs
This example shows you how to obtain the power spectrum of a sine wave signal. First, generate a sine wave that
you want to analyze using the LabVIEW Analysis VIs, then use the Copy Mem(LV to DSP) VI to copy the data of
this sine signal to the DSP board. Before you copy the data, you must call the DSP Allocate Memory VI to allocate
a DSP Handle Cluster that reserves a data buffer on the DSP board. Connect this DSP Handle Cluster to the
destination in terminal of the Copy Mem(LV to DSP) VI to indicate where the data will be stored on the DSP
board. After the data is copied to the DSP board, call the DSP Power Spectrum VI to perform a power spectrum on
the data. After you finish the analysis, the results are stored in the data buffer indicated by the DSP Handle Cluster
you previously allocated. If you want to see the results, call the Copy Mem(DSP to LV) VI to copy data back to
LabVIEW. Figure 1-10 shows the power spectrum of a sine wave. The last step is to call the DSP Free Memory VI
to free the DSP Handle Cluster that you allocated. This example connects all of the error out clusters of the
previous VIs to the error in clusters of the subsequent VIs to establish the proper sequence and to pass through an
error, should it occur, without executing the rest of the VIs.
NI-DSP SRM for LabVIEW for Windows1-9Part 2: Introduction to the NI-DSP Analysis VIs
Chapter 1
NI-DSP Analysis VI Reference Overview
This chapter contains an overview of the NI-DSP Analysis VIs and includes a list of the VIs. This chapter describes
how the NI-DSP Analysis VIs are organized and how to access them.
The NI-DSP Analysis VI Overview
The NI-DSP Analysis VIs are a set of high-performance VIs that efficiently process large blocks of numerical data
and perform numerically intensive computations. The NI-DSP Analysis VIs include numerical analysis, signal
generation, digital signal processing, digital filtering, and windowing operations that are suitable for simulation,
modeling, and sophisticated data processing.
The NI-DSP Analysis VIs are presented in alphabetical order in Chapter 2, NI-DSP Analysis VI Reference.
Table 1-1 lists these VIs by group.
DSP Add
DSP Subtract
DSP Multiply
DSP Divide
DSP Absolute
DSP Square Root
DSP Product
DSP Sum
DSP Log
DSP Clip
DSP Reverse
DSP Shift
DSP Sort
DSP Linear Evaluation
DSP Max & Min
DSP Polynomial Evaluation
DSP Subset
DSP Set
DSP Unwrap
DSP Polar to Rectangular
DSP Rectangular to Polar
Memory Management
DSP Allocate Memory
Copy Mem(LV to DSP)
Copy Mem(DSP to LV)
Copy Mem(DSP to DSP)
DSP Free Memory
DSP Index Memory
DSP Init Memory
Part 3: NI-DSP Function Reference1-2NI-DSP SRM for LabVIEW for Windows
Chapter 1NI-DSP Analysis VI Reference Overview
Table 1-1. The NI-DSP Analysis VI Groups (Continued)
Utility Functions
DSP Reset
DSP Load
DSP Start
DSP Timeout
DSP Custom
DSP DMA Copy(DSP to LV)
DSP DMA Copy(LV to DSP)
DSP Handle to Address
Analysis VI Organization
After installation, the NI-DSP Analysis VIs reside in the following VI library files (LabVIEW .LLB files) within
the DSP2200 option:
•Signal Generation contains VIs that generate digital patterns.
•Frequency Domain contains VIs that perform frequency domain transformations, frequency domain analysis,
and other transforms such as the Hartley transform.
•Time Domain contains VIs that perform direct time series analysis of signals.
•Filters contains VIs that perform IIR and FIR filtering functions.
•Windows contains VIs that perform smoothing windowing.
•Array contains VIs that perform arithmetic operations on arrays.
•Memory Management contains VIs to perform allocating, indexing, copying, and freeing memory on the
AT-DSP2200 board.
•Utility contains VIs for controlling the operation of the AT-DSP2200 board.
After installation, the eight analysis VI libraries appear in the Functions menu in the order shown in the preceding
list under the DSP2200 option. You can reorganize the folders and the VIs to suit your needs and applications.
Accessing the NI-DSP Analysis VIs
To access the analysis VIs from the block diagram window, choose DSP2200 from the Functions menu as shown in
Figure 1-1, proceed through the hierarchical menus, and select the VI you want. The icon corresponding to that VI
appears in the block diagram and is ready to be wired.
NI-DSP SRM for LabVIEW for Windows1-3Part 3: NI-DSP Function Reference
Loading...
+ 127 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.