SCPI commands of HDM3065B - Page 1
Forum section: electronics / testgear

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 15, 2022, 08:10:36 am
content: 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?

author: Kean
author_rank: Unknown
timestamp: November 15, 2022, 08:25:32 am
content: 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.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 15, 2022, 09:05:39 am
content: 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?

author: Kean
author_rank: Unknown
timestamp: November 15, 2022, 10:33:32 am
content: 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/starthttps://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 thisCode:import vxi11instr = vxi11.Instrument("192.168.1.71")print(instr.ask("*IDN?"))# returns Rohde&Schwarz,HMC8012,xxxxxxxx,01.400Attached 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.

author: alm
author_rank: Super Contributor
timestamp: November 15, 2022, 11:33:33 am
content: Quote from: Kean on November 15, 2022, 10:33:32 amJust a note that you can usePyVisa-pyas 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.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 16, 2022, 06:25:45 pm
content: Huge thanks to Kean for your help and support, I think I should get my hands dirty with some pyton code.QuoteThanks for the tip alm.