开云体育

GPIB scripting software?


 

Looking for suggestions regarding useable GPIB script routines
that can be used for setting up a system with 897B/8971C and a Local
oscillator system. It does take some time doing this step by step.
?
No need for retrieving data but using a routine that initializes
all parts would be nice.
?
I saw a thread about Matlab routines but not having an account
with Mathworks since I left the university and not wanting to try
either 30 days trials or 20 hours "online" a month, I am looking for
a lasting alternative.
?
Cheers
?
Ulf Kylenfall
SM6GXV


 

Simple GPIB routines can be sent to devices using MS Excel if you enable the developer tab in Excel. This gives access to a Visual Basic GUI.


 

开云体育

Hi Ulf,

I have developed some Python routines that do just that: control the HP8970B/HP8971C/HP8673B. I can send them to you. They are basically testroutines, but set up the system correctly and wil allow to make measurements. It assumes the Keysight IO system works correct. Run from Windows command prompt.

Let me know if interested.

Best regards,

Harke, PA0HRK


On 15/09/2024 11:12, Ulf Kylenfall via groups.io wrote:

Looking for suggestions regarding useable GPIB script routines
that can be used for setting up a system with 897B/8971C and a Local
oscillator system. It does take some time doing this step by step.
?
No need for retrieving data but using a routine that initializes
all parts would be nice.
?
I saw a thread about Matlab routines but not having an account
with Mathworks since I left the university and not wanting to try
either 30 days trials or 20 hours "online" a month, I am looking for
a lasting alternative.
?
Cheers
?
Ulf Kylenfall
SM6GXV


 

Hello Ulf,

Python is another possibility. If you have not used python before, you should find a lot of info online.?
Even ChatGPT has gotten fairly good at writing python code, so if you give it a good description you will have a good starting point.
It will probably not be able to make it perfect, but a good starting point for beginners.

Regards,
Askild


On Sun, Sep 15, 2024 at 11:12?AM Ulf Kylenfall via <ulf_r_k=[email protected]> wrote:
Looking for suggestions regarding useable GPIB script routines
that can be used for setting up a system with 897B/8971C and a Local
oscillator system. It does take some time doing this step by step.
?
No need for retrieving data but using a routine that initializes
all parts would be nice.
?
I saw a thread about Matlab routines but not having an account
with Mathworks since I left the university and not wanting to try
either 30 days trials or 20 hours "online" a month, I am looking for
a lasting alternative.
?
Cheers
?
Ulf Kylenfall
SM6GXV


 

I access GPIB devices directly (GPIB) or via USB using Visual Basic.
It is free as part of Visual Studio, easy to use and understand, and works with NI VISA and KEYSIGHT.
?
ed


 

I do the same with my own Prologix-clone


 

?
I have submitted my e-mail address to Harke Smits.
?
In a project some years ago, I used python routines written by others
but never had the time to dive into this language.
?
Looking forward to what I will receive.
?
Cheers
?
Ulf Kylenfall
SM6GXV


 

On Sun, Sep 15, 2024 at 03:27 AM, Askild wrote:
Python is another possibility.
Yes. If the instrument you are using does SCPI, then it's not to hard to write some code in Python to do some basic measurements.
?
AFAIK, if you have the working GPIB hardware.
Keysight 82357B USB/GPIB Interface
or
Keysight 82350B PCI GPIB Interface
?
and have downloaded and installed?
pyVISA (Python Library for VISA), free
Keysight VISA (Virtual Instrument Software Architecture) an API for instrument control, has GPIB
?
The software might be free; but, the devil will be in the details, if you have to manually install them.
?
Here is a basic Python program get an instrument to measure voltage using SCPI (Standard Commands for Programmable Instruments) command set,if the instuments you are using supports it. Not sure the 897B does.
Any program bugs, are free, like the other software.
?
import pyvisa
# Initialize VISA Resource Manager
rm = pyvisa.ResourceManager()
# Find? instruments
instruments = rm.list_resources()
print("Available Instruments:", instruments)
# Open session to an instrument (assuming GPIB device at address 3)
instrument = rm.open_resource('GPIB0::3::INSTR')
# Write a command
instrument.write('MEASURE:VOLTAGE?')
# Read response
response = instrument.read()
print("Instrument Response:", response)
# Close? session
instrument.close()
?
You can do something similar coding in C, and compile it; but, there's way more fiddly bits to get wrong.
?
?


 

On Sun, Sep 15, 2024 at 02:12 AM, Ulf Kylenfall wrote:
I saw a thread about Matlab
Not sure of the advantage of Matlab... unless you want to do some fancy (or not so fancy) processing on the data.
If you do, and can write Matlab code... or just drive it from the Matlab Console... then Matlab would do it.
?
A free... pretty faithful clone of Matlab is Octave.
Unless you need Simulink , and Toolboxes... then free doesn't cost very much.
?
These two packages are for 'vector based' programming, if that's your thing.
?
Otherwise, and maybe, with all the Python libraries available... Python is pretty good too.
?


 

Python + prologix adapter is about as simple, portable, and dependency free as it gets.

Open the port with the python "serial" library, and send direct GPIB commands to it.

No need to install any drivers or i/o libraries, basically just plug and play!


On Mon, Sep 16, 2024 at 12:25?AM Anders via <anders.gustafsson=[email protected]> wrote:
I do the same with my own Prologix-clone


 

开云体育

Agree. Very simple. I use it a lot.

Word of warning: Older HP instruments (and probably others, pre SCPI I'd say) do NOT like the "auto-reply" and you should disable that.

Mark


From: [email protected] <[email protected]> on behalf of Andrew Hakman <andrew.hakman@...>
Sent: Monday, September 16, 2024 7:27 PM
To: [email protected] <[email protected]>
Subject: Re: [HP-Agilent-Keysight-equipment] GPIB scripting software?
?
Python + prologix adapter is about as simple, portable, and dependency free as it gets.

Open the port with the python "serial" library, and send direct GPIB commands to it.

No need to install any drivers or i/o libraries, basically just plug and play!

On Mon, Sep 16, 2024 at 12:25?AM Anders via <anders.gustafsson=[email protected]> wrote:
I do the same with my own Prologix-clone


 

开云体育

I have a couple of working HP82357A USB/GPIB interfaces available to sell.

?

?75 ea. based in UK if anyone is interested.

Regards

Nigel

?

From: [email protected] <[email protected]> On Behalf Of Roy Thistle via groups.io
Sent: 17 September 2024 02:04
To: [email protected]
Subject: Re: [HP-Agilent-Keysight-equipment] GPIB scripting software?

?

On Sun, Sep 15, 2024 at 03:27 AM, Askild wrote:

Python is another possibility.

Yes. If the instrument you are using does SCPI, then it's not to hard to write some code in Python to do some basic measurements.

?

AFAIK, if you have the working GPIB hardware.
Keysight 82357B USB/GPIB Interface
or
Keysight 82350B PCI GPIB Interface

?

and have downloaded and installed?
pyVISA (Python Library for VISA), free
Keysight VISA (Virtual Instrument Software Architecture) an API for instrument control, has GPIB

?

The software might be free; but, the devil will be in the details, if you have to manually install them.

?

Here is a basic Python program get an instrument to measure voltage using SCPI (Standard Commands for Programmable Instruments) command set,if the instuments you are using supports it. Not sure the 897B does.
Any program bugs, are free, like the other software.

?

import pyvisa

# Initialize VISA Resource Manager
rm = pyvisa.ResourceManager()

# Find? instruments
instruments = rm.list_resources()
print("Available Instruments:", instruments)

# Open session to an instrument (assuming GPIB device at address 3)
instrument = rm.open_resource('GPIB0::3::INSTR')

# Write a command
instrument.write('MEASURE:VOLTAGE?')

# Read response
response = instrument.read()
print("Instrument Response:", response)

# Close? session
instrument.close()

?

You can do something similar coding in C, and compile it; but, there's way more fiddly bits to get wrong.

?

?


 

开云体育

With free Python libraries like sci-kit, numpy and matplotlib you probably do not need Matlab (licensed) anymore. The Matlab clone Octave is for free. With the mentioned Python libraries it takes only a couple of lines of code to read a touchstone file and plot the 4 s-parameters on a Smith chart. There are examples to design an microwave lna based on these libraries (yes some more lines are needed). Nice stuff, I only scratched the surface so far.

Harke

On 17/09/2024 03:15, Roy Thistle wrote:

On Sun, Sep 15, 2024 at 02:12 AM, Ulf Kylenfall wrote:
I saw a thread about Matlab
Not sure of the advantage of Matlab... unless you want to do some fancy (or not so fancy) processing on the data.
If you do, and can write Matlab code... or just drive it from the Matlab Console... then Matlab would do it.
?
A free... pretty faithful clone of Matlab is Octave.
Unless you need Simulink , and Toolboxes... then free doesn't cost very much.
?
These two packages are for 'vector based' programming, if that's your thing.
?
Otherwise, and maybe, with all the Python libraries available... Python is pretty good too.
?


 

开云体育

Do you have a simple example at hand? I used the Prologix adapter in the past with KE5FX toolbox but never with pyvisa. I prefer to use Python as I want more data processing options than available with the kit.

H

On 17/09/2024 04:27, Andrew Hakman wrote:

Python + prologix adapter is about as simple, portable, and dependency free as it gets.

Open the port with the python "serial" library, and send direct GPIB commands to it.

No need to install any drivers or i/o libraries, basically just plug and play!

On Mon, Sep 16, 2024 at 12:25?AM Anders via <anders.gustafsson=[email protected]> wrote:
I do the same with my own Prologix-clone


 

Did anyone mention EZGPIB?

Windows only, works with NI and Prologix (but not all clones though, without some effort.)

It does work with NI USB-GPIB devices, running in a Windows VM guest on Linux.? The NI baggage, only needs installing in the Windows guest VM, not on the host.

The scripting language is Pascal based, so easy to learn.? All the GPIB handling is done for you, so it's just the basic instrument programming you need to figure out.

Free too.? Sadly it's author has passed, but his site lives on.


A lot of other good info there too.? Including worked examples in the download for several popular instruments and tasks.

Dave B.

(Used it once or twice for soak testing high power RF/Microwave amplifier repairs.)


--
Created on and sent from a Unix like PC running and using open source software:


 

开云体育

Somewhat OT, but: ChatGPT is quite good at turning English into Python, especially if you have a subscription that allows you to run their latest chain-of-thought model.? See for instance.?

?

That was generated by the freebie model (GPT 4o) that everyone has access to.? It knows about scikit-rf, but you have to download and run the resulting Python program yourself (which is relatively trivial even in Windows these days). ?

?

I didn’t ask it about retrieving GPIB data, and wouldn’t expect miracles if you ask it specifically about Prologix device access.? But it will certainly be able to provide code for basic serial or Ethernet communications if you can articulate what you need it to do.

?

-- john, KE5FX

?

From: [email protected] <[email protected]> On Behalf Of Harke Smits via groups.io
Sent: Tuesday, September 17, 2024 3:20 AM
To: [email protected]
Subject: Re: [HP-Agilent-Keysight-equipment] GPIB scripting software?

?

Do you have a simple example at hand? I used the Prologix adapter in the past with KE5FX toolbox but never with pyvisa. I prefer to use Python as I want more data processing options than available with the kit.


 

# 7854.py - try out some gpib data collection using the Prologix gpib-usb controller
#

import os
import termios
import serial
import time

def gpib_init() :
ser.write("++mode 1\r")
time.sleep(0.1)
ser.write("++ifc\r")
time.sleep(0.1)
ser.write("++auto 0\r")
time.sleep(0.1)
ser.write("++eoi 0\r")
time.sleep(0.1)

def gpib_read(addr):
ser.write("++addr " + str(addr) + "\r")
time.sleep(0.1)
ser.write("++read eoi\r")
return ser.readline()

def gpib_write(addr,gpibstr):
ser.write("++addr " + str(addr) + "\r")
time.sleep(0.1)
ser.write(gpibstr + "\r")

#
# test program...
#

ser = serial.Serial('/dev/ttyUSB0',rtscts=0,timeout=1)

ser.write("++ver\r")
print ser.readline()

gpib_init()

gpib_write(10,"ID?\r")
print "ID= " + gpib_read(10) + "\r"

gpib_write(10,"VMDR\r")
gpib_write(10,"HMDB\r")

gpib_write(10,"STORED\r")

gpib_write(10,"1 0 2 4 >P/W AVG10\r")
gpib_read(10)

gpib_write(10,"SENDX\r")
time.sleep(4)

print "X=" + gpib_read(10) + "\r"
print "X=" + gpib_read(10) + "\r"


-Chuck Harris

On Tue, 17 Sep 2024 12:20:03 +0200 "Harke Smits via groups.io"
<yrrah@...> wrote:
Do you have a simple example at hand? I used the Prologix adapter in
the past with KE5FX toolbox but never with pyvisa. I prefer to use
Python as I want more data processing options than available with the
kit.

H

On 17/09/2024 04:27, Andrew Hakman wrote:
Python + prologix adapter is about as simple, portable, and
dependency free as it gets.

Open the port with the python "serial" library, and send direct
GPIB commands to it.

No need to install any drivers or i/o libraries, basically just
plug and play!

On Mon, Sep 16, 2024 at 12:25?AM Anders via groups.io
<> <anders.gustafsson@...> wrote:

I do the same with my own Prologix-clone





 

Chat GPT?

Here, that is known by many as "Automated Incompitence", with very good reason.

Fun to play with, but wouldn't trust it as far as I can spit.

Dave "KBV.


 

"Often wrong but never in doubt." In that sense, ChatGPT emulates humans pretty well. ;)

--
Prof. Thomas H. Lee
Allen Ctr., Rm. 205
420 Via Palou Mall
Stanford University
Stanford, CA 94305-4070

On 9/17/2024 11:28 AM, Dave_G0WBX via groups.io wrote:
Chat GPT?

Here, that is known by many as "Automated Incompitence", with very good reason.


 

开云体育

If you’re much older than I am, you’ll get along fine with this attitude.? If you’re much younger, it would be a catastrophic error, likely a career-limiting one.?

?

From my own intermediate point of view, I can go either way… just throwing it out there as a suggestion.? ??

?

The point is, don’t be afraid of Python, as there are helpful resources that weren’t available until recently.

?

-- john, KE5FX

?

From: [email protected] <[email protected]> On Behalf Of Dave_G0WBX via groups.io
Sent: Tuesday, September 17, 2024 11:29 AM
To: [email protected]
Subject: Re: [HP-Agilent-Keysight-equipment] GPIB scripting software?

?

Chat GPT?

?

Here, that is known by many as "Automated Incompitence", with very good reason.

?

Fun to play with, but wouldn't trust it as far as I can spit.

?

Dave "KBV.

?