Programming Guide
SIGLENT
SDL1000X Programming Guide 57
4. Programming Examples
This chapter gives some examples for the programmer. In these examples
you can see how to use the VISA or sockets, in combination with the
commands have been described above to control the spectrum analyzer. By
following these examples, you can develop many more applications.
4.1 Examples of Using VISA
4.1.1 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:
1、 Open Visual Studio, create a new VC++ win32 console project.
2、 Set the project environment to use the NI-VISA lib, there are two ways to
use NI-VISA, static or automatic:
(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) 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.