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

下载
页码 157
Getting Started with the NI-DSP Interface Utilities
Chapter 2
Part 4:  NI-DSP Interface Utilities
2-10
NI-DSP SRM for LabVIEW for Windows
The array of DSP Handle Clusters holds all the references to arrays of data used by the custom DSP functions.  You
should bundle the DSP Handle Clusters together to an array in the order they appear in the first group of parameters
in the custom function on the DSP board.  For example, if the first three parameters of the custom function are the
arrays X, Y, and Z, which correspond to the DSP Handle Clusters in LabVIEW, hdl1hdl2, and hdl3, respectively,
then you must bundle hdl1hdl2, and hdl3 to an array in that order.  The same order requirements apply to the array
of 32-bit floating-point scalars that holds the LabVIEW parameters corresponding to the second group of the
parameters in the custom function.  Likewise, the array of 32-bit integer scalars that holds the LabVIEW parameters
corresponding to the third and final group of parameters in the custom function must also have the same order
requirements as the other arrays.
Bundle all of the parameters of the same type to an array before you call Custom VI.  Remember that the order in
which you bundle the parameters should correspond to the order of the terminals in the corresponding group of the
custom function.  The first element in the array representing a group should correspond to the first parameter of the
same group in the custom function, and so on.
The Custom VI is the interface from LabVIEW to all of the custom functions on the DSP board.  Each parameter of
the custom functions on the DSP board require two corresponding terminals in LabVIEW–an input control to
reserve the space on the DSP board for the data, and an output indicator to hold the result.  All of the output arrays in
the Custom VI are internally connected to the corresponding input arrays.
The Custom VI treats all of the parameters in the custom functions as input/output parameters.  The parameters that
represent outputs of the custom function must also be bundled in LabVIEW in the array that holds all of the other
input parameters of the same type.  Although the output parameters, whether scalars or arrays, do not contain any
valid or useful information on input, they will be overwritten by the return values.  The parameters that represent
inputs to the custom functions also exist in the corresponding output arrays, although the values of the output arrays
are the same values as on input–the custom function will not change the parameter values.
Figure 2-6 shows how to bundle the parameters for 
gmaxmin.c
.  Allocate two DSP Handle Clusters corresponding
to the input array z and the output array y.  The bundling order is as follows–the DSP Handle Cluster representing z
is first, followed by the DSP Handle Cluster representing y.  y is the output array.  The data in this array is not valid
as an input, but you must still allocate it first and bundle it with other DSP Handle Clusters that represent input
arrays.  Notice that although the parameters max valuemin valuemax index, and min index are outputs only in
gmaxmin.c
, you must first bundle the additional four input scalars with the actual input parameters to reserve
space in memory for the parameters on output.  The initial values are not important.  The parameter n (the number of
elements) is only an input parameter in 
gmaxmin.c
, but you will still have an output corresponding to this
parameter, although the output and input values are the same.
Z
Y
N
Figure 2-6.  How to Bundle Parameters in LabVIEW to Call 
gmaxmin.c