UNI-T MSO/UPO2000 Series Programming Manual page 152

Digital phosphor oscilloscope
Table of Contents

Advertisement

Programming Manual
fopen(vt);
%Send the string "*IDN?",asking for the device's identification.
fprintf(vt,'*IDN?');
%Request the data
outputbuffer = fscanf(vt);
disp(outputbuffer);
%Close the VISA object
fclose(vt);
delete(vt);
clear vt;
end
Python
Example
Environment: Window system, Python3.8, PyVISA 1.11.0
Description: Access the instrument via USBTMC and TCP/IP, send "*IDN?" command on NI-VISA to
query the device information.
Steps:
1.
Install python firs, and then turn on Python script compiling software, create an empty test.py file.
2.
Use pip install PyVISA instruction to install PyVISA, if it cannot install, please refer to this link
(https://pyvisa.readthedocs.io/en/latest/)
3.
Source code:
Example
USBTMC
a)
import pyvisa
rm = pyvisa.ResourceManager()
rm.list_resources()
my_instrument = rm.open_resource('USB0::0x5345::0x1234::SN20220718::INSTR')
print(my_instrument.query('*IDN?'))
Example
TCP/TP
b)
import pyvisa
rm = pyvisa.ResourceManager()
rm.list_resources()
my_instrument = rm.open_resource('TCPIP0::192.168.20.11::inst0::INSTR')
print(my_instrument.query('*IDN?'))
Instruments.uni-trend.com
MSO/UPO2000 Series
152 / 156

Advertisement

Table of Contents
loading

Table of Contents