National Instruments PC-OPDIO-16 Telescope User Manual


 
The Fundamentals of Building Applications with NI-DAQChapter 4
PC-OPDIO-16 User Manual 4-8 © National Instruments Corporation
The NI-DAQ Libraries
The NI-DAQ for Windows function libraries are DLLs, which means that NI-DAQ routines are
not linked into the executable files of applications. Only the information about the NI-DAQ
routines in NI-DAQ import libraries are stored in the executable files. For that reason,
Windows-executable files are usually smaller than DOS-executable files.
Import libraries contain information about their DLL exported functions. They indicate the
presence and location of the DLL routines. Depending on the development tools you are using,
you may give the DLL routines information through import libraries or through function
declarations.
Using functional prototypes is a good programming practice. That is why NI-DAQ is packaged
with functional prototype files for four different Windows development tools. The installation
utility copies the appropriate prototype files for the development tools you choose. If you are not
using any of the four development tools that NI-DAQ supports, you must create your own
functional prototype file.
NI-DAQ Programming Considerations
In addition to knowing how to use the NI-DAQ DLL, you should consider some special
problems that can occur when you access certain NI-DAQ routines. This section briefly
describes the nature of the problems. The following sections, which are specific to each
language, give the methods for solving the problems.
Buffer Allocation
Allocating memory in a Windows application is much more restrictive than is normally
encountered in a non-Windows application. Windows requires you to allocate all memory
through the Windows memory manager, and thus has its own memory-allocation functions. In
most cases, you should use these functions rather than the memory-allocation functions normally
used by a specific language.