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-11 NI-DSP SRM for LabVIEW for Windows
2.  Call the Custom VI
After you  bundle all of the parameters to arrays, connect each array to the corresponding terminals of the Custom
VI.  Figure 2-7 shows how to connect to the Custom VI for the 
gmaxmin.c
.
Figure 2-7.  How to Connect to Custom VI to Call 
gmaxmin.c
If your custom function does not have a certain type of parameter, leave the corresponding terminal unwired.  This is
important for passing your parameters correctly from LabVIEW to the DSP board.
The value of the function ID is the custom function ID that you obtain from 
dspfncs.h
.  This ID determines
which custom function on the DSP board the Custom VI calls.  To call the correct function on the DSP board, you
must supply the appropriate function ID.  In this example, the function ID is 448, which you obtained in step 5 of
creating your custom NI-DSP Library.  Finally, you must indicate the slot number on which to execute the custom
VI.  In Figure 2-6, the slot parameter terminal is left unwired.  This causes all VIs to execute on the default DSP
board, which is set to slot 3.
3.  Index the Output Arrays to Obtain the Results
All of the output results are in the output arrays of the Custom VI.  You can read the output arrays to see the results.
If you want to operate on some output parameters, use the method for indexing an array to extract an element from
an array.  The order of the output parameters in an output array is identical to the order in the corresponding input
array.
Figure 2-8 shows how to index the output arrays of the Custom VI to obtain the results of 
gmaxmin.c
.  The
Custom VI leaves the output data buffers on the board, and returns only the DSP Handle Clusters that indicate the
locations of these buffers on the board.  You must use the Copy Mem(DSP to LV) VI to copy data back to
LabVIEW.  The Custom VI always copies scalars back to LabVIEW.