[COM] Communication issue with Agilent 33250A using pyvisa
See original GitHub issueI am using pyvisa to connect to 33250A, however it works not well. The code shown below worked well for Agilent 2700.
import pyvisa
rm = pyvisa.ResourceManager()
print(rm.list_resources())
inst = rm.open_resource(u'GPIB0::10::INSTR')
print(inst.query("*IDN?"))
The error is occurred line 4 ,
rm.open_resource(u'GPIB0::10::INSTR')
The detail is shown below,
Traceback (most recent call last):
File "C:/Users/56942/PycharmProjects/NI-instruments/main.py", line 4, in <module>
inst = rm.open_resource(u'GPIB0::10::INSTR')
File "C:\Users\56942\PycharmProjects\NI-instruments\venv\lib\site-packages\pyvisa\highlevel.py", line 3271, in open_resource
info = self.resource_info(resource_name, extended=True)
File "C:\Users\56942\PycharmProjects\NI-instruments\venv\lib\site-packages\pyvisa\highlevel.py", line 3197, in resource_info
ret, err = self.visalib.parse_resource_extended(self.session, resource_name)
File "C:\Users\56942\PycharmProjects\NI-instruments\venv\lib\site-packages\pyvisa\ctwrapper\functions.py", line 2089, in parse_resource_extended
for val in (resource_class, unaliased_expanded_resource_name, alias_if_exists)
File "C:\Users\56942\PycharmProjects\NI-instruments\venv\lib\site-packages\pyvisa\ctwrapper\functions.py", line 2089, in <listcomp>
for val in (resource_class, unaliased_expanded_resource_name, alias_if_exists)
File "C:\Users\56942\PycharmProjects\NI-instruments\venv\lib\site-packages\pyvisa\ctwrapper\types.py", line 74, in buffer_to_text
return buf.value.decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)
('GPIB0::10::INSTR',)
Process finished with exit code 1
and it works well by using connect expert
Output of pyvisa-info
Machine Details:
Platform ID: Windows-10-1909 Processor: Intel® Core™ i5-4200M CPU @2.5GHz 2.49GHz
Python:
Interpreter: Python 3.7.3 PyVISA Version: 1.11.3 NI version: NI-488.2 18.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PyVISA mac OS X (Mountain Lion) Agilent 33250a
I am having trouble connecting to an Agilent 33250a instrument using a GPIB-USB controller. Does anybody have any ideas how I can get...
Read more >AgilentPython/agilent_python3.py at master - GitHub
Wrapper over pyvisa for remote control of Agilent 33250A ... Class for communicating with Agilent Arbitrary Waveform Generator 33250A.
Read more >Issue with arbitrary waveform and Agilent 33250A
Dear all, I'm fighting with the communication protocol between my VIs and an Agilent 33250A (manual here ). I'm thus seeking for help....
Read more >Agilent 33250A User's Guide - RS Components
The Agilent Technologies 33250A is a high-performance 80 MHz synthesized function generator with built-in arbitrary waveform and pulse capabilities. Its ...
Read more >34401A GPIB VISA TIME OUT ERRORS - Keysight Community
It is Windows XP 2000 SP3. I still use VB6 and VBA to program test software. The problem also occurs with the Agilent...
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
I assume you are using a Keysight USB to GPIB adapter. This kind of adapter can only be used in conjunction with the adapter manufacturer VISA implementation. You could also try to use the Keysight VISA conflict manager (In connection expert look under Tools, and specify to use Keysight VISA for GPIB resources, it may solve your issue without having to explicitly pass the path to the dll.
Thank you for your advice. The problem is related to the two type of VISA. I solved the problem by
Although the problem was solved, I have some questions. If I have only NI-VISA installed, my computer could not recognize GPIB devices in the Measurement & Automation Explorer. Only if both NI-VISA and Keysight VISA were installed, my computer worked well.