Author Topic: SCPI - VISA generator scripting software  (Read 1001 times)

0 Members and 1 Guest are viewing this topic.

Offline EJCTopic starter

  • Newbie
  • Posts: 6
  • Country: ca
SCPI - VISA generator scripting software
« on: April 25, 2026, 09:36:14 pm »
Hello!

If anyone is interested I wrote a small program for scripting output from up to 3 SCPI capable signal generators. Each step of a sequence sets function (sine, ramp, square or dc), voltage, frequency and offset for a duration of 0.5 or more seconds.  It's main use is for 3-axis magnetic field experiments driven by signal generators but could be used to script 1-3 generators for any purpose.

http://gadgetlab.sdf.org/Axistential/

It's only been tested with DG2052 and MSO5074 outputs. Any feedback would be welcome!
« Last Edit: April 27, 2026, 04:35:04 am by EJC »
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8825
  • Country: ca
Re: USBTMC generator scripting software
« Reply #1 on: April 26, 2026, 03:30:25 pm »
thks   well check,   but we are lan based ...  surely possible to mod it for that ?



We use a python script to control 2 sig gens, at different intervals and timings,  sdg 1032x series and a ssg3032x and other interfaces
we dont want to rely on a visa layer,  simple lan config on the generators,  a presence checkup is done,  and go ?

we had glitches on Visa drivers before, whatever NI or Rhode Schwartz  ....  and dont want to use Keysight I/O librairies,  as lightweight it can be, and no OS compatibility   Nux or Windows ..


« Last Edit: April 26, 2026, 03:40:40 pm by coromonadalix »
 

Offline EJCTopic starter

  • Newbie
  • Posts: 6
  • Country: ca
Re: USBTMC generator scripting software
« Reply #2 on: April 26, 2026, 11:41:39 pm »
Edit: I changed the program to try all devices including TCPIP so this may work for you. If you need to add specific parameters for the connection you can enter them in the connect_unit function on line 1237 just substitute the 'pass' line with your code:
    #put TCPIP device specific parameters here
    elif unit_id.find("TCPIP") != -1:
        pass

What types of glitches did you run into with the VISA layer? I mostly use the program in linux and pyvisa-py backend handles the VISA layer.
« Last Edit: April 27, 2026, 05:21:38 am by EJC »
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8825
  • Country: ca
Re: SCPI - VISA generator scripting software
« Reply #3 on: April 27, 2026, 02:34:50 pm »
oh  thks    refered to some guys here too ...  ill poke in it

i need to check if it can sequence say : 2 gens, 1 after the other, but i will need to trig an rf switch between the 2 ...

i need to check  8  inputs of a machine, take measurements in RF and switch gen to UHF and redo some tests


thks for your time   :-+


for the glitches it where :

With Labview software(s), with their Ni-visa, and other tests tools needed RS-visa,  and eventually Keysight  meters  ....  yeah  compatibility issues,  Visa drivers versions,  some added huge detection lags in the more recent, had to downgrade ...

Ni stuff install tons of useless crap (for me)  net monitoring  and many others ...   that's why it was simpler in LAN  with a simple IP setting



your software

I use NI-Visa ...

tried  ....  while scanning, it does see my USB connected SSG3032X  in the secondary windows in IDLE ...    but  end with no detection, and trying to close the detection windows, it circle endlessly ?   

i'm not python guru  loll  i have to check if it needs some configs  before lauch ... 

I normally launch in "Idle the program"    Python 3.14  x64

Pmw_Axistential.py   gives :  = RESTART: xxxxxx  \Axistential-Source-Python\Pmw_Axistential.py
Axistential.pyw         does run, and give the scanning errors
« Last Edit: April 27, 2026, 03:16:33 pm by coromonadalix »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2801
  • Country: us
Re: SCPI - VISA generator scripting software
« Reply #4 on: April 27, 2026, 04:33:50 pm »
To just send SCPI commands (actually tunnel GPIB) over IP, a Python VXI-11 implementation is all that's needed.

https://pypi.org/project/python-vxi11/#files

It says "over ethernet", but it's really over IP with zero dependency on ethernet.

If you're going to use NI software, then VISA is needed, not because it does anything really that VXI-11/LXI-11 doesn't, but because it supports enumeration and discovery, so the software can offer an instrument selection dialog or dropdown.
 

Offline EJCTopic starter

  • Newbie
  • Posts: 6
  • Country: ca
Re: SCPI - VISA generator scripting software
« Reply #5 on: April 27, 2026, 07:21:33 pm »
Ok thanks for trying it out!  From the error.txt it looks like the error originated in the VISA.dll and then my program didn't catch it properly. I fixed the catch problem (I think) but there appears to be an issue with your backend (visa32.dll).  Since it's not required for pyvisa when using TCPIP I would try removing it all together (or run the program in linux!).

Anyway, it should handle back-end fail more gracefully now if you do any more testing.

Let me know how it goes, if you need any modifications I'm happy to oblige!

And yes Axistential.pyw is the file to launch from.

Cheers,
John
« Last Edit: April 27, 2026, 07:42:11 pm by EJC »
 

Offline mr ed

  • Regular Contributor
  • *
  • Posts: 221
  • Country: ca
Re: SCPI - VISA generator scripting software
« Reply #6 on: April 28, 2026, 12:56:10 am »
Python3 and pivisa is the way to go if simplicity is desired without or if you really have to, with a gui.  Python will run on anything from a raspberry to a supercomputer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->