AttributeError: function 'viOpen' not found

35 Views Asked by At

My code starts like this

import pyvisa as visa import os

rm = visa.ResourceManager('C:\Program Files (x86)\IVI Foundation\VISA\WinNT\agvisa\agbin\visa32.dll') my_connect = rm.open_resource("USB0::0x2A8D::0x0B0B::MY47191118::0::INSTR")

I am trying to control my Keysight Signal Analyzer using VISA.

When I try to run my python code it throws me this error.

Traceback (most recent call last): File "C:\Users\kolap\Downloads\MeasurementControlCode\MeasurementControlCode\scan_signal_analyzer.py", line 45, in

rm = visa.ResourceManager('C:\Program Files (x86)\IVI Foundation\VISA\WinNT\agvisa\agbin\visa32.dll')

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\highlevel.py", line 2992, in new visa_library = open_visa_library(visa_library)

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\highlevel.py", line 2904, in open_visa_library return cls(argument)

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\highlevel.py", line 191, in new obj._init()

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 172, in _init functions.set_signatures(self.lib, errcheck=self._return_handler)

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\ctwrapper\functions.py", line 324, in set_signatures apply(

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\ctwrapper\functions.py", line 226, in internal set_signature(library, function_name, argtypes, restype, errcheck)

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\ctwrapper\functions.py", line 418, in set_signature func = getattr(library, function_name)

File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\ctypes_init_.py", line 389, in getattr func = self.getitem(name) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\ctypes_init_.py", line 394, in getitem func = self._FuncPtr((name_or_ordinal, self))

AttributeError: function 'viOpen' not found

So the info for pyvisa is as shown in the image enter image description here

0

There are 0 best solutions below