Programming Guide

Digital Oscilloscopes Series
149
Example of VC++
Environment: Win7 32bit system, Visual Studio
The functions of this example: use the NI-VISA, to control the
device with USBTMC or TCP/IP access to do a write and read.
Follow the steps to finish the example:
1Open Visual Studio, create a new VC++ win32 project.
2Set the project environment to use the NI-VISA lib, there are
two ways to use NI-VISA, static or automatic:
2.1 Static: find files: visa.h, visatype.h, visa32.lib in NI-VISA
install path. Copy them to your project, and add them into
project. In the projectname.cpp file, add the follow two lines:
#include "visa.h"
#pragma comment(lib,"visa32.lib")
2.2 Automatic:
Set the .h file include directory, the NI-VISA install path, in
our computer we set the path is : C:\Program Files\IVI
Foundation \VISA\WinNT\include. Set this path to project---
properties---c/c++---General---Additional Include Directories:
See the picture.