National Instruments 320571-01 Car Stereo System User Manual


 
Chapter 2 Getting Started with the NI-DSP Interface Utilities
NI-DSP SRM for LabVIEW for Windows 2-5 Part 4: NI-DSP Interface Utilities
2. Compile and/or Assemble Source Code
Compile all new C source files and assemble all new assembly source files using the WE DSP32C C compiler and
assembler. Remember to use only float and long data types for scalars. If you use any of the error codes from
Appendix A, Error Codes, include ATDSP.h at the beginning of your source code. A function that completes with
no error should return noError or zero. The ATDSP.h file is in the Lib directory. After you have installed the
WE DSP32C tools, you may want to copy ATDSP.h to the Include directory in the root directory for those tools.
In this example, use d3cc -c gmaxmin.c to generate WE DSP32C object code.
3. Add Your Object Filenames to a Linker File (ifile)
The next step is to modify the file NIDSPLNK to add the names of your custom object files to the list of modules to
be linked into your custom DSP Library. NIDSPLNK is a source file containing link editor directives for the WE
DSP32C tools. This modification is illustrated in Figure 2-1.
essent.o
stackbld.o
/*** Add all your file names after this comment line ***/
gmaxmin.o
/*** Add all your file names above this comment line ***/
-lLVDSP
Figure 2-1. Linker File NIDSPLNK
Copy the NIDSPLNK file from the LIB directory to your working directory and then modify the copy. This ensures
that you maintain the original ifile. Also, you need to copy the files essent.o, dsp_glob.o, and
stackbld.s, from the LIB directory to your working directory.
Note: Add your function(s) name(s) to this file between the comments instructing you to do so. Do not modify
this file in any other way.
4. Add Your New Function Names to a Library Function List File
Copy the files NIDSP.fnc and NIESSEN.fnc from the Dispatch directory to your working directory.
In Figure 2-2, the file NIDSP.fnc shows the addition of the function DSP_GMaxMin to the library function list.
This is done by editing the file NIDSP.fnc in the current directory. Add this function to a new group, My
Functions, at the end of this file.
** My Functions
DSP_GMaxMin
Figure 2-2. Library Function List File NIDSP.fnc