[COM] Communication issue with HP3577A using GPIB and VISA
See original GitHub issueI use a HP3577 connected via a genuine NI USB-GPIB-HS adapter to my host PC. It used to work last week, then I suddenly couldn’t run my scripts any more. I noticed that even a minimal code:
import pyvisa as visa
rm = visa.ResourceManager()
print(rm)
hp = rm.open_resource('GPIB0::11::INSTR')
print(hp)
hp.write('AB4')
Caused the issue:
Resource Manager of Visa Library at C:\WINDOWS\system32\visa32.dll
GPIBInstrument at GPIB0::11::0::INSTR
Traceback (most recent call last):
File "D:\Github_Sixtimesseven\VisaInstruments\Simplevisa\SimpleVisa\untitled0.py", line 14, in <module>
hp.write('AB4')
File "C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\pyvisa\resources\messagebased.py", line 197, in write
count = self.write_raw(message.encode(enco))
File "C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\pyvisa\resources\messagebased.py", line 157, in write_raw
return self.visalib.write(self.session, message)[0]
File "C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\pyvisa\ctwrapper\functions.py", line 2796, in write
ret = library.viWrite(session, data, len(data), byref(return_count))
File "C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 222, in _return_handler
return self.handle_return_value(session, ret_value) # type: ignore
File "C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\pyvisa\highlevel.py", line 251, in handle_return_value
raise errors.VisaIOError(rv)
VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Causes the instrument to go into remote and lock up (power cycle required), it does not set average mode 4 (AB4 command) which is tested and should work and has worked last week. I tried another instrument and it was not working as well (Keithley 238).
I tried another PC and uninstalling visa and the 488-2 drivers. I reinstalled the oldest (17.6) version and updated pyvisa (it was already up to date). Right now I can talk to the other instruments but the HP3577 locks up as before.
Instrument details
- Model: HP3577A
- Communication: GPIB
- Link to the documentation (if available): https://www.pearl-hifi.com/06_Lit_Archive/15_Mfrs_Publications/20_HP_Agilent/HP_3577A_3-Chan_VNA/HP_3577A_Operators.pdf
Output of pyvisa-info
C:\Users\justrandom\anaconda3\envs\ba21\lib\site-packages\gpib_ctypes\gpib\gpib.py:54: UserWarning: GPIB library not found. Please manually load it using _load_lib(filename). All GPIB functions will raise OSError until the library is manually loaded.
warnings.warn(message)
Machine Details:
Platform ID: Windows-10-10.0.19042-SP0
Processor: AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
Python:
Implementation: CPython
Executable: C:\Users\justrandom\anaconda3\envs\ba21\python.exe
Version: 3.9.7
Compiler: MSC v.1916 64 bit (AMD64)
Bits: 64bit
Build: Sep 23 2021 07:24:41 (#default)
Unicode: UCS4
PyVISA Version: 1.11.3
Backends:
ivi:
Version: 1.11.3 (bundled with PyVISA)
#1: C:\WINDOWS\system32\visa32.dll:
found by: auto
bitness: 64
Vendor: National Instruments
Impl. Version: National Instruments
Spec. Version: National Instruments
#2: C:\WINDOWS\system32\visa64.dll:
found by: auto
bitness: 64
Vendor: National Instruments
Impl. Version: National Instruments
Spec. Version: National Instruments
py:
Version: 0.5.2
ASRL INSTR: Available via PySerial (3.5)
USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1
USB RAW: Available via PyUSB (1.2.1). Backend: libusb1
TCPIP INSTR: Available
TCPIP SOCKET: Available
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
Can I use a GPIB-USB-B to talk to a HP3577A Network analizer
Hello, We have a GPIB-USB-B which we used on a project several years ago on another instrument. We now want to be able...
Read more >Mobile friendly online documentation · Issue #2 - GitHub
No bitness for NI-VISA backend in Mac OS #122 ... [COM] Communication issue with HP3577A using GPIB and VISA #640.
Read more >Troubleshooting GPIB Interface - MATLAB & Simulink
GPIB support in MATLAB ® is provided through the VISA-GPIB interface. Issue. If you are having trouble connecting to or communicating with your...
Read more >How can I make NI LabVIEW communicate with my 82357A ...
When using NI LabVIEW, it is not always necessary to install NI-VISA. ... Turn the instrument on and ensure that it is configured...
Read more >VENABLE WINDOWS VERSION 4.5 RLC SOFTWARE AND ...
Installation Procedure for use with GPIB Adapter . ... If any problem occurs with the Venable software attempting to communicate to the.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, hmm. I’m pretty sure I rebooted the instrument yesterday. Maybe I did not open a new spyder console… I did unplug and change the gpio adapter usb location (usb 2 to usb 3). Not sure why but now it seems to be working.
Test script:
My fix in resource.py line 162
Not that great but it works…
Sure, if I find some time first I will look into it. Otherwise I would be happy to test your patch.