Tuesday, February 14, 2006

Compiling and Running NI-DAQ Examples in Microsoft Visual C++

From NI-DAQ 6.9.2 Readme File
© Copyright 2001 National Instruments. All rights reserved.

Compiling and Running NI-DAQ Examples in Microsoft Visual C++

To compile and run examples, follow these steps:

Open a new project by going to File»New. The Projects tab should come up by default.
Select Win32 Console Application as the type of project, and give your project a name.
Select Empty Application. When you have created a new project, it shows your folder menu on the left and the file screen on the right. When you double-click any file you have in your project, the file displays on the right side. To make navigation easier, change from Class View to File View.

Go to Project»Add to Project»File.
Select the NI-DAQ\LIB directory, and add the nidaq32.lib file and the nidex32.lib file. You should also insert the nidaqex.h and nidaq.h file from the NI-DAQ\Include folder. Adding two libraries and header files to your project integrates the source code for most of the data acquisition application examples.

Go to Tools»Options, and select the Directories tab.

a. Set the option to Include Files. Make sure that you point to the same directory in NI-DAQ\Include.
b. From the same tab, set the option to Libraries and set a path for NI-DAQ\LIB.

If you are using any applications that use Easy I/O functions, you need to include additional files because the Easy I/O functions use some functions from the CVI Run-Time libraries. The additional libraries are easyio.lib, cvisupp.lib, cvirt.lib, and cviwmain.lib and are located in the CVI\EXTLIB directory.

a. Go to Tools»Options, and select the Directories tab.
b. Set the option to Include Files. Point to the CVI\INCLUDE directory.
c. From the same tab, set the option to Libraries, and set a path for CVI\EXTLIB.

Add the source code and header if needed to the project that you want to use.
You should now be able to build the project into an executable.


Note : Analog input uses differential as default

0 Comments:

Post a Comment

<< Home