¿ªÔÆÌåÓý

8510C operation using NI usb GPIB control device and Pyvisa


 

Using a NI usb GPIB control device i like to operate a 8510C using a laptop running Pyvisa. I've installed the software for the NI device (quite a bit of this unfortunately). However, just plugging in the device to the laptop and the 8510C then the laptop doesnt seem to see the VNA connected, so i'm not quite sure what to do next. The HP manuals dont really discuss using a usb interface and the NI website dosent give much help either. On the NI website there is this further download, the "Agilent 8510C Analyzer, Certified LabVIEW Plug and Play (project-style) Instrument Driver", but i'm not sure if this is what i need.

Any advice much appreciated.
Neil?

?


 

On 7/2/24 11:04, neil via groups.io wrote:
Using a NI usb GPIB control device i like to operate a 8510C using a laptop running Pyvisa. I've installed the software for the NI device (quite a bit of this unfortunately). However, just plugging in the device to the laptop and the 8510C then the laptop doesnt seem to see the VNA connected, so i'm not quite sure what to do next. The HP manuals dont really discuss using a usb interface and the NI website dosent give much help either. On the NI website there is this further download, the "Agilent 8510C Analyzer, Certified LabVIEW Plug and Play (project-style) Instrument Driver", but i'm not sure if this is what i need.

Have you done this? ask it to list instruments attached with an address?

$python3
import pyvisa

rm = pyvisa.ResourceManager()
rm.list_resources()
libgpib: invalid descriptor
libgpib: invalid descriptor
.
.
.
.
.
ibgpib: invalid descriptor
('GPIB0::3::INSTR',)


this example told you address 3 was found.

Try it with a voltmeter also...just to test it works.

If you think your GPIB-USB-HS is suspect, run the NI tools that check for it. (I don't have that windows computer with NI stuff on right now or I'd check). I'm using pyvisa on linux. It's supposed to be the same once you are in a terminal window running python.

I've collected some pieces of an 8510C setup, so maybe I can get one and try it...from linux.
Are you using GPIB cables between instruments and the GPIB-USB-HS piggy backed on one?


 

Running the three lines of Python i just get:

Exception in comms call get_value:

? File "C:\Users\Neil\anaconda3\envs\pyvisa_py\lib\site-packages\spyder_kernels\comms\commbase.py", line 344, in _handle_remote_call
? ? self._set_call_return_value(msg_dict, return_value)

lots of similar lines and then:

ValueError: ctypes objects containing pointers cannot be pickled

So i dont even thing the PC (running Windows 10) is seeing even the usb GPIB adapter which is plugged in the the usb port of the laptop inspite of all the NI code downloaded and installed. The GPIB adapter is just plugged inthe 8510C and the device is running normally with all the cables connected.

I'll have a look for the NI tools to see if it can find the adapter.

many thanks, Neil


 

well no, ignore the above. With the GPIB connected only the the laptop, and running the above three lines i get:

('ASRL6::INSTR',)

when i then plug the GPIB into the 8510C and run the three lines i get exactly the same, so connecting up the VNA makes no difference. So i'm just confused.


 

I am not a windows guy... not even slightly, but I know
beyond a shadow of a doubt that a windows machine needs a
windows device driver for every new type of USB device it
encounters.

-Chuck Harris


On Tue, 02 Jul 2024 14:07:47 -0700 "neil via groups.io"
<salmon.na@...> wrote:
well no, ignore the above. With the GPIB connected only the the
laptop, and running the above three lines i get:

('ASRL6::INSTR',)

when i then plug the GPIB into the 8510C and run the three lines i
get exactly the same, so connecting up the VNA makes no difference.
So i'm just confused.





 

On 7/2/24 14:45, neil via groups.io wrote:
Running the three lines of Python i just get:
Exception in comms call get_value:
File "C:\Users\Neil\anaconda3\envs\pyvisa_py\lib\site-packages\spyder_kernels\comms\commbase.py", line 344, in _handle_remote_call
? ? self._set_call_return_value(msg_dict, return_value)

Yes, as Chuck says, try the NI tool, and always reboot after SW installs.

The above error msg could mean pyvisa and python are not installed right.

I didn't do a pyvisa windows install, just verified
the GPIB-USB-HS was not counterfeit, so I could sell it to NI labview users... I still have one, one sold, and I'll be learning more about AR488 soon and selling the other GPIB-USB-HS for $$ on ebay. Use the hardware listing and checking tool by NI. It's part of the many SW pieces NI installs.


 

On 7/2/24 15:07, neil via groups.io wrote:
well no, ignore the above. With the GPIB connected only the the laptop, and running the above three lines i get:
('ASRL6::INSTR',)

=====================================
As for the bus, things like "GPIB", "USB", "ASRL" (for serial/parallel interface) are possible. So for connecting to an instrument at COM2, the resource name is

ASRL2


So, there's no GPIB communication yet.

--
John


 

Included in the NI software you installed (which i assume was NI VISA and maybe some other things) should be a program called NI MAX - measurement and automation explorer.? I suggest using that to determine if your computer sees the instrument or not.? Once the program opens, in the tree on the left, expand devices and interfaces, and you should see the usb-gpib and connected instrument (and if not, you know what your problem is). ?I'll be away from my 8510c for a few days but if you're still working on this by the time i get back to it i can send some screenshots.

If the adapter shows up but the instrument still doesn't, i suggest checking that you're connected to the correct gpib port on the 85101c (display unit) - one connects to the other boxes in the stack, the other to the computer.

I believe that the driver you reference would be useful only if you are using labview, so i don't think it's what you are looking for.

I also recommend downloading the ke5fx toolbox, I find the VNA tool to provide a huge quality of life improvement when using my 8510C.


 

Thanks for the great help. I tried the NI MAX but neither the usb-gpib adapter nor the 8510C appear. I tried with only the adapter connected to the laptop, then with connection to the laptop and connection to the 8510C as well, then changed over on the 8510C to the separate HP-IB port, with still no indication of usb-gpib or 8510C. The adapter was bought from Farnell specifically for a Windows machine.
I'll try the ke5fx toolbox you recommended, see how far i can get with that. Thank you.


 

Assuming a default NI install...

Go one step back from Python.

Using NiMax, select the NI GPIB-USB in the tree list on the left.
If the NI device is not listed, you have a bad/faulty device, or failed NI software instalation.

(Where did you get your NI GPIB-USB device from?? There are many older firmware clones about, that may not work with the latest NI drivers.)

If it is present in the tree list, and selected when clicked on, then "Scan for instruments" in the menu bar of the right side window.

Report back what it finds.

If that fails, PyVisa won't find it either.

Obviously, the instrument needs to be connected and powered up.

Dave B.


 

Not quite.

It needs the "Windows" driver for the NI GPIB interface for sure.

The "Instrument Drivers" are usually part of the application software you run (and maybe create) that in turn uses the installed VISA and/or NI subsystems to reach the instruments.

The VISA subsystem if used, sits between your application software and the NI-GPIB, serial or LAN interfaces, giving great flexibility in regards to how you communicate with your measuring kit.

(You just change the VISA resource details, to change from say, GPIB to LAN.? The rest of your code stays the same, usually.)

You can use VISA calls to serial or LAN connected devices, without the GPIB interface present, should you need.? Once all the NI (or Agilent equivalent) baggage is installed.

WARNING!!!? ?Do not try to install NI and Agilent VISA interface systems on the same machine.? It can be done, but is NOT trivial due to many naming conflicts.? 99.9% of the time, it is easier to reinstall Windows and start over than unpick the resulting mess!

You can guess how I learnt that!

Dave B




 

thanks for the good comments and some progress with NI Max now.

Under 'Devices and Interfaces', there is indeed "NI GPIB-USB-HS+ GBIB0" as an entry, in addition to that of the ASRL6, so the PC is seening the adapter.

On clicking the "NI GPIB-USB-HS+ GBIB0" and clicking 'Scan for instruments' it indicates "No instruments were found duing the instrument scan", but when i connect up to the 8510C and repeat this, it indicates "Instrument scan completed normally". So it at least realises something is connected on the other end of the adapter cable.


 

Further progress :) with the 8510C connected up and running the three lines of the above Python code it get:

('ASRL6::INSTR', 'GPIB0::16::INSTR', 'GPIB0::17::INSTR').

So that is a relief, something seems to be working from the Python code!

many thanks, Neil


 

I'm not certain about this, but, many USB based adapters
use a chip, such as FTDI's USB <-> RS232 adapter chip, as
their interface to the USB realm. The problem is, the FTDI
FT232 is one of the world's most counterfeited chips.

China makes them by the millions. Well, FTDI got mad, and
forced microsoft to include a driver that silently refuses
to work with the otherwise compatible counterfeit chips. At
one point, FTDI actually had their driver detect the
counterfeit parts, and reprogram them so that they would no
longer function.

Anyway, it seems likely to me that the NI MAX would use
the FTDI adapter chip.

Somewhere in the spectrum of China counterfeits is NI GPIB
adapters of the USB sort... Which seem likely to be made
using the China counterfeit FT232 USB chips.

Are you certain your adapter is genuine?

Big companies, like Farnell, can get fooled too!

I would contact NI, and tell them your problem. I am sure
they have a quick and easy way of identifying a fake NI adapter.

-Chuck Harris


On Tue, 02 Jul 2024 23:57:59 -0700 "neil via groups.io"
<salmon.na@...> wrote:
Thanks for the great help. I tried the NI MAX but neither the
usb-gpib adapter nor the 8510C appear. I tried with only the adapter
connected to the laptop, then with connection to the laptop and
connection to the 8510C as well, then changed over on the 8510C to
the separate HP-IB port, with still no indication of usb-gpib or
8510C. The adapter was bought from Farnell specifically for a Windows
machine. I'll try the ke5fx toolbox you recommended, see how far i
can get with that. Thank you.





 

¿ªÔÆÌåÓý

FWIW, Pyvisa uses the LabView or BenchVue drivers and installed adapters as it's communication layer.? I use Pyvisa with BenchVue for some lab automation.? The graduate students run the same Pyvisa code on top of LabView.

The free BenchVue only wants to play with a small modern subset of available HPIB/GPIB instruments.? It is most useful for probing things like VXI cards while deciphering the switch settings and memory environments...



Get


From: [email protected] <[email protected]> on behalf of Chuck Harris via groups.io <cfharris@...>
Sent: Wednesday, July 3, 2024 8:31:17 AM
To: [email protected] <[email protected]>
Subject: Re: [HP-Agilent-Keysight-equipment] 8510C operation using NI usb GPIB control device and Pyvisa
?
I'm not certain about this, but, many USB based adapters
use a chip, such as FTDI's USB <-> RS232 adapter chip, as
their interface to the USB realm.? The problem is, the FTDI
FT232 is one of the world's most counterfeited chips.

China makes them by the millions.? Well, FTDI got mad, and
forced microsoft to include a driver that silently refuses
to work with the otherwise compatible counterfeit chips.? At
one point, FTDI actually had their driver detect the
counterfeit parts, and reprogram them so that they would no
longer function.

Anyway, it seems likely to me that the NI MAX would use
the FTDI adapter chip.

Somewhere in the spectrum of China counterfeits is NI GPIB
adapters of the USB sort... Which seem likely to be made
using the China counterfeit FT232 USB chips.

Are you certain your adapter is genuine?

Big companies, like Farnell, can get fooled too!

I would contact NI, and tell them your problem.? I am sure
they have a quick and easy way of identifying a fake NI adapter.

-Chuck Harris


On Tue, 02 Jul 2024 23:57:59 -0700 "neil via groups.io"
<salmon.na@...> wrote:
> Thanks for the great help. I tried the NI MAX but neither the
> usb-gpib adapter nor the 8510C appear. I tried with only the adapter
> connected to the laptop, then with connection to the laptop and
> connection to the 8510C as well, then changed over on the 8510C to
> the separate HP-IB port, with still no indication of usb-gpib or
> 8510C. The adapter was bought from Farnell specifically for a Windows
> machine. I'll try the ke5fx toolbox you recommended, see how far i
> can get with that. Thank you.
>
>
>
>
>







 

¿ªÔÆÌåÓý

I agree, I installed the usb NI GPIB s/w and it all works fine, then later i got an HP/Agilent usb adapter as well and installed that too.

I found that it worked ok as well but the NI one no longer works.

On examination it looks like the two instances can exist together but it is the dll driver which needs to be the right one for each adapter-a fairly simple swap restores operations for either usb adapter on my system.

Although i would concede that i dont need both instances installed and was really just tinkering to see how they behaved¡­

My main reason was i needed to test three of the Agilent 82937A adapters i intend to sell¡­

Just my 2p worth.
Regards?
Nigel?


On 3 Jul 2024, at 10:29, Dave_G0WBX via groups.io <g8kbvdave@...> wrote:

?
Not quite.

It needs the "Windows" driver for the NI GPIB interface for sure.

The "Instrument Drivers" are usually part of the application software you run (and maybe create) that in turn uses the installed VISA and/or NI subsystems to reach the instruments.

The VISA subsystem if used, sits between your application software and the NI-GPIB, serial or LAN interfaces, giving great flexibility in regards to how you communicate with your measuring kit.

(You just change the VISA resource details, to change from say, GPIB to LAN.? The rest of your code stays the same, usually.)

You can use VISA calls to serial or LAN connected devices, without the GPIB interface present, should you need.? Once all the NI (or Agilent equivalent) baggage is installed.

WARNING!!!? ?Do not try to install NI and Agilent VISA interface systems on the same machine.? It can be done, but is NOT trivial due to many naming conflicts.? 99.9% of the time, it is easier to reinstall Windows and start over than unpick the resulting mess!

You can guess how I learnt that!

Dave B




 

To test further, might anybody have a sample python pyvisa program to take multiple consequtive frequency sweeps of the four S-parameters from the 2-port 8510C and write data to a file, or just some sample programs to help me up this learning curve?

many thanks, Neil?


 

Hi.

It is safe to say, that NI do not use any USB<>Serial bridge chipset in their GPIB-USB-HS+ devices, it's all proprietary (to NI) chipsets and/or firmware.

Adapters like the Prologix devices (and many clones, even many Arduino based AR488 devices) DO use USB<>Serial Bridge chipsets, and it's pot luck what chipset you get!

If older Prolific based hardware is used, Windows will spit feathers and refuse to use it, unless you block Windows Updates, and manually roll back the Prolific driver to a very old version.? (If Windows 10/11 will let you do that these days.)

There ARE some clone (counterfeit?) GPIB-USB adapters on the world market, both NI and HPAK types.? They seem to work with older instances of their supposed makers companion software, but certainly the NI latest software suite has issues with them.? I am told it's something to do with the old version firmware they contain.

In any case, it sounds like Neil is making progress in the right direction now with the kit he has.

Regards to All.

Dave B.

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


 

Neil,

Glad to hear you're making progress.? I'm not sure i can offer much help with the python side specifically.

Dave,

I too have played the game of reinstalling windows because it was easier then fixing the mess.? What i learned works was:

1. Install NI, test (by plugging in an instrument and making sure it talks)
2. Install Keysight, test
3. Install Tektronix, test

I've done this a few times now and been able to simultaneously operate Hewlett-Agi-sight, Tektronix, NI and Keithley instruments from the same computer at the same time.


 

Well done Jason.

Dave B