Programming Manual UTG900E Series
Instruments.uni-trend.com
VISA Programming Example
Given some programming Example, this page can help you understand how to use VISA, operate the device
as per the commands details, and develop more applications.
VC++ Example
Condition: Windows System & Visual Studio.
Description: Access the device through the USBTMC and TCP/IP, and send the "*IDN?" command in
NI-VISA to check the device information.
Steps
1. Open the Visual Studio software, and newly create a VC++ win32 console project.
2. Set the project condition for calling NI-VISA library, with Static Library and Dynamic Library.
a) Static Library
Copy the visa.h, visatype.h, visa32.lib files in NI-VISA installation path to the root path of VC++ project
and add them to the project. Add the following codes to the projectname.cpp file:
#include "visa.h"
#pragma comment(lib,"visa32.lib")
b) Dynamic Library
Click the "project>>properties", select the "c/c++---General" in the left side of properties dialog, and set
the "Additional Include Directories" content to the installation path of NI-VISA,(For example,
C:\ProgramFiles\IVI Foundation\VISA\WinNT\include), as followings showed.
Select the "Linker-General" in the left side of properties dialog, and set the "Additional Library
Directories" content to the installation path of NI-VISA, (For example, C:\Program Files\IVI
Foundation\VISA\WinNT\include), as followings showed.