National Instruments PC-OPDIO-16 Manuale Utente

Pagina di 92
© National Instruments Corporation
4-1
PC-OPDIO-16 User Manual
Chapter 4
Fundamentals of Building Applications
with NI-DAQ
_____________________________________________________________________________
This chapter contains general information about building NI-DAQ applications that run in DOS
and Windows and explains the nature of the files needed and the basics of making applications.
You can skip this chapter if you are an experienced NI-DAQ user.
Building DOS Applications with NI-DAQ
This section contains general information about building NI-DAQ applications that run in DOS
and explains the nature of the files needed and the basics of making applications using the
following compilers:
Microsoft C
Microsoft Visual Basic
Turbo C++ and Borland C++
Borland Turbo Pascal
In the DOS environment, a set of function libraries provides the NI-DAQ functions.  You
compile and then link an application that makes calls to these functions to the appropriate library
for that compiler.
Creating a DOS Application Using Microsoft C
The NI-DAQ library for Microsoft C (
NIDAQMSC.LIB
) is compiled using the large memory
model.  It is therefore essential that you install the large memory model of your Microsoft C
Compiler.  If you have the files 
llibce.lib
 and 
llibc7.lib
 in the 
LIB
 directory of your
C compiler, you have the large memory model installed.  Perform the following steps:
1. Create your source code.  Follow the instructions in this manual and the NI-DAQ Function
Reference Manual for PC Compatibles when making calls to NI-DAQ functions.  Be sure to
use the functional prototypes by including 
NIDAQ.H
 in your source file.  You can find the
file 
NI_DAQ.H
 in the 
C_EX
 subdirectory under your NI-DAQ directory.
Note: You must call the 
USE
 function in your application before calling any other
NI-DAQ functions. This function causes portions of the NI-DAQ library that are
required to use your DAQ product to be included in your application. If you do not
call the appropriate 
USE
 function, your other NI-DAQ functions will return error -
421 (functionNotLinkedErr).