Products > Test Equipment
SCPI commands of HDM3065B
ali_asadzadeh:
Today my HDM3065B device has received, Unfortunately the SCPI commands documentation is in Chinese! and this is the first time I have a equipment that has SCPI commands, so I want to know if some one here has this device and can help me to learn to use it?
How should I use it over Ethernet or USB?
Kean:
I don't have a HDM3065, but have experience with SCPI programming. What exactly do you want to do with it? Do you want to write your own code in Python, or just use a pre-built app?
To get started, something like TestController should work with it. While it doesn't seem to be supported as standard, the SCPI commands should be very similar to a Siglent SDM3055/3065 which is supported.
https://www.eevblog.com/forum/testgear/program-that-can-log-from-many-multimeters/
Definitely use Ethernet if possible. Much better than USB, but a little more setup is needed if you want a fixed IP address on your network.
ali_asadzadeh:
Thanks for the help, I wanted to use it over Ethernet, and want to be able to measure and record the measurements remotely. so if there is a ready app, I would use it over implementing it from scratch. do you suggest any tutorial on SCPI programming?
Kean:
There are multiple ways to implement SCPI from Python (let alone other languages).
Personally I tend to use the python-vxi11 library, but there is also other libraries like easy-scpi and pyvisa. I prefer to avoid the overhead of VISA which the latter ones require installed.
Here are some links that might help.
https://www.eevblog.com/forum/testgear/python-scripts-to-control-instruments-using-lxi-scpi-no-drivers-required/
http://alexforencich.com/wiki/en/python-vxi11/start
https://goughlui.com/2021/03/28/tutorial-introduction-to-scpi-automation-of-test-equipment-with-pyvisa/
https://pypi.org/project/easy-scpi/
With python-vxi11 connecting to a DMM can be as simple as this
--- Code: ---import vxi11
instr = vxi11.Instrument("192.168.1.71")
print(instr.ask("*IDN?"))
# returns Rohde&Schwarz,HMC8012,xxxxxxxx,01.400
--- End code ---
Attached is a sample "quick and dirty" script I often use to sweep a 0-10V dimming input of an AC powered LED driver, recording both DC and AC measurements.
It uses python-vxi11 for network SCPI control of a HMC8042 PSU and a HMC8012 DMM, and the plain serial library for serial SCPI control of a Tonghui TH3321 AC Power Meter.
I've also attached sample CSV output from the script.
alm:
--- Quote from: Kean on November 15, 2022, 10:33:32 am ---There are multiple ways to implement SCPI from Python (let alone other languages).
Personally I tend to use the python-vxi11 library, but there is also other libraries like easy-scpi and pyvisa. I prefer to avoid the overhead of VISA which the latter ones require installed.
--- End quote ---
Just a note that you can use PyVisa-py as backend for pyvisa, so you don't have to install something heavy like NI VISA. This is mostly worth it if you want to be able to control the same instrument via multiple protocols, like USBTMC and VXI-11, and easily switch between them. Higher level libraries, like easy-scpi, will generally use pyvisa so they can support variety of protocols.
If you just want to use VXI-11, then python-vxi11 is the easier solution. The instrument will probably also support sending commands using a plain TCP/IP socket. You can do this through PyVISA or using the Python socket library (or any other programming language's TCP socket library) directly.
Navigation
[0] Message Index
[#] Next page
Go to full version