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-4
NI-DSP SRM for LabVIEW for Windows
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.