Programming Guide
49
4 Programming Examples
This chapter gives some examples for the programmer. In these examples you can see
how to use the NI-VISA lib and the commands which have been described before this
chapter to control our devices. By the examples’ guide, you can develop more functions
application as you want. This example is developed by Visual Studio project.
Main topics of this part:
Example of Vc++
Example of VB
Example of MATLAB
Example of LabVIEW
4.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:
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.
Summary of Contents for SDG5000 series
Page 38: ...SDG5000 User Manual 27 Figure 2 5 Setting the Offset ...
Page 109: ...SDG5000 User Manual 98 Figure 3 1 Sine Waveform ...
Page 111: ...SDG5000 User Manual 100 Figure 3 2 Square Waveform ...
Page 129: ...SDG5000 User Manual 118 3 12 Figure 3 12 FSK Waveform ...
Page 135: ...SDG5000 User Manual 124 Figure 3 15 DSB AM Waveform ...