National Instruments 320571-01 用户手册

下载
页码 157
Chapter 2
Getting Started with the NI-DSP Interface Utilities
NI-DSP SRM for LabVIEW for Windows
2-9
Part 4:  NI-DSP Interface Utilities
The 
makelib.bat
 batch file performs the following:
1.
makelib.bat
 assembles the file 
stackbld.s
 in the current directory using the AT&T 
d3as.exe
assembler.  You need to assemble this file because it includes the file 
stackbld.s
, created by the
Dispatch
 program, and contains the assembly code that determines which function the DSP board executes.
The file 
dispatch.s
 reflects the organization and content of the DSP Library file as is reflected by the library
function list file, 
NIDSP.fnc
, in the current directory.
2.
makelib.bat
 rebuilds the DSP Library file with name 
libfile.out
 (the name you decided to give to the
new DSP Library file).  This new DSP Library file always has the Kernel, memory management routines,
execution control routines, data communication routines, interrupt handling routines for data acquisition, and
the functions listed in the library function list file 
NIDSP.fnc.
3.
makelib.bat
 lists all undefined symbols from the DSP Library file.  These symbols could be undefined
because you did not link all the object modules.
Any other error messages that are encountered are WE DSP32C error messages.  Refer to the WE DSP32C Support
Software Library
 User Manual for information.
At this point, the WE DSP32C tools have generated a custom DSP Library file.
Creating Your LabVIEW Interface
Now that you have added a function to the DSP Library, you need to be able to call this function from LabVIEW
using a VI.  The NI-DSP Analysis VIs contains a VI called Custom VI in the Utility folder.  You can use the Custom
VI to call any function on the DSP board that follows the guidelines listed in the Guidelines for the Custom
Functions
 section earlier in this chapter.
To create your LabVIEW interface, follow these steps:
1.
Bundle all the input parameters to arrays.
2.
Call the Custom VI.
3.
Index the output arrays to get the results.
1.  Bundle All of the Input Parameters to Arrays
Use the Custom VI in the Utility folder of the DSP2200 folder as the interface for calling custom functions on the
DSP board from LabVIEW.  You can use three types of data for input/output parameters in the Custom VI.  The data
types correspond to the different types of parameters that you can use in your custom functions on the DSP board.
Custom functions have three groups of parameters–pointers to arrays of data (any type; 32-bit floating point, 32-bit
integer, and 16-bit integer), pointers to 32-bit floating-point scalars, or pointers to 32-bit integer scalars.  All of the
parameters in a group must be the same type.  You must arrange the custom function parameters so that the group of
all array pointers (if the function has any) are first, followed by the group of all pointers to 32-bit floating-point
scalars (if the function has any), followed by the group of all pointers to 32-bit integer scalars.  The LabVIEW
interface to such a custom function, Custom VI, should reflect the same parameter order.
The number of parameters varies for different functions.  To use the Custom VI as the interface for different custom
functions, you must bundle the same types of parameters to an array.  LabVIEW can check the array sizes in the CIN
to determine how many parameters to pass to a custom function on the DSP board from LabVIEW.  For this reason,
Custom VI uses arrays as input/output parameter types.  The number of parameters of a custom function is the sum
of the sizes of three arrays of the Custom VI.