UNI-T MSO/UPO2000 Series Programming Manual page 141

Digital phosphor oscilloscope
Table of Contents

Advertisement

Programming Manual
Add file visa.h in projectname.cpp file
#include <visa.h>
Source code:
1.
a)
USBTMC Example
int usbtmc_test()
{ /** This code demonstrates sending synchronous read & write commands
* to an USB Test & Measurement Class (USBTMC) instrument using NI-VISA
* The example writes the "*IDN?\n" string to all the USBTMC
* devices connected to the system and attempts to read back
* results using the write and read functions.
* Open Resource Manager
* Open VISA Session to an Instrument
* Write the Identification Query Using viPrintf
* Try to Read a Response With viScanf
* Close the VISA Session*/
ViSession defaultRM;
ViSession instr;
ViUInt32 numInstrs;
ViFindList findList;
ViStatus status;
char instrResourceString[VI_FIND_BUFLEN];
unsigned char buffer[100];
int i;
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
Instruments.uni-trend.com
MSO/UPO2000 Series
141 / 156

Advertisement

Table of Contents
loading

Table of Contents