Author Topic: SCPI commands of HDM3065B  (Read 808 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1967
  • Country: ca
SCPI commands of HDM3065B
« on: November 15, 2022, 08:10:36 am »
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?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline Kean

  • Supporter
  • ****
  • Posts: 2468
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: SCPI commands of HDM3065B
« Reply #1 on: November 15, 2022, 08:25:32 am »
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.
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1967
  • Country: ca
Re: SCPI commands of HDM3065B
« Reply #2 on: November 15, 2022, 09:05:39 am »
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?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline Kean

  • Supporter
  • ****
  • Posts: 2468
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: SCPI commands of HDM3065B
« Reply #3 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.

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: [Select]
import vxi11
instr =  vxi11.Instrument("192.168.1.71")
print(instr.ask("*IDN?"))
# returns Rohde&Schwarz,HMC8012,xxxxxxxx,01.400

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.
 
The following users thanked this post: ali_asadzadeh

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: SCPI commands of HDM3065B
« Reply #4 on: November 15, 2022, 11:33:33 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.
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.
 
The following users thanked this post: ali_asadzadeh, Kean

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1967
  • Country: ca
Re: SCPI commands of HDM3065B
« Reply #5 on: November 16, 2022, 06:25:45 pm »
Huge thanks to Kean for your help and support, I think I should get my hands dirty with some pyton code.

Quote
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.
Thanks for the tip alm.
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf