National Instruments 320571-01 用户手册

下载
页码 157
Part 2
Introduction to the NI-DSP Analysis VIs
NI-DSP SRM for LabVIEW for Windows
1-3
Part 2:  Introduction 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
X
X
X
3
0
0
4
}
}
Board Number of 
Owner DSP Board
Index into the 
MLUT of the 
Owner DSP Board
Special Code
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.
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.