National Instruments Car Stereo System 320571-01 用户手册

下载
页码 157
Introduction to the NI-DSP Analysis VIs
Part 2
Part 2:  Introduction to the NI-DSP Analysis VIs
1-2
NI-DSP SRM for LabVIEW for Windows
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, Memory
Management 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 VI
Reference
, 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