OE-FET / keithley2600

Python driver for Keithley 2600 series instruments.
https://keithley2600.readthedocs.io
MIT License
41 stars 17 forks source link

ValueError: No device found. #21

Open mustafacc opened 2 years ago

mustafacc commented 2 years ago

I'm getting a ValueError("No device found.") exception when attempting to connect to the instrument. I'm checking the instrument in the NI Max device manager and it is available and I can communicate with it. Any help would be appreciated!

Operating system: Windows 10 21H2 - 64bit Python: Python 3.9.5 (anaconda distribution) Keithley model: Keithley 2604B connected via USB

image

  File "C:\Users\user\Nextcloud\Lab data LC group\MLP01-4060-Scylla\Mustafa\20211015_KeithleyCtrl_py3\example.py", line 9, in <module>
    k = Keithley2600('USB0::0x05E6::0x2604::4371376::INSTR')

  File "C:\ProgramData\Miniconda3\lib\site-packages\keithley2600\keithley_driver.py", line 1684, in __new__
    instance = Keithley2600(*args, **kwargs)

  File "C:\ProgramData\Miniconda3\lib\site-packages\keithley2600\keithley_driver.py", line 842, in __init__
    Keithley2600Base.__init__(

  File "C:\ProgramData\Miniconda3\lib\site-packages\keithley2600\keithley_driver.py", line 567, in __init__
    self.connect(**kwargs)

  File "C:\ProgramData\Miniconda3\lib\site-packages\keithley2600\keithley_driver.py", line 585, in connect
    self.connection = self.rm.open_resource(self.visa_address, **kwargs)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa\highlevel.py", line 3304, in open_resource
    res.open(access_mode, open_timeout)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa\resources\resource.py", line 297, in open
    self.session, status = self._resource_manager.open_bare_resource(

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa\highlevel.py", line 3232, in open_bare_resource
    return self.visalib.open(self.session, resource_name, access_mode, open_timeout)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa_py\highlevel.py", line 167, in open
    sess = cls(session, resource_name, parsed, open_timeout)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa_py\sessions.py", line 323, in __init__
    self.after_parsing()

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa_py\usb.py", line 81, in after_parsing
    self.interface = self._intf_cls(

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa_py\protocols\usbtmc.py", line 287, in __init__
    super(USBTMC, self).__init__(vendor, product, serial_number, **kwargs)

  File "C:\ProgramData\Miniconda3\lib\site-packages\pyvisa_py\protocols\usbtmc.py", line 199, in __init__
    raise ValueError("No device found.")

ValueError: No device found.

image

mtorrec commented 2 years ago

I am experiencing the same issue, were you finally able to connect to the instrument?

mustafacc commented 2 years ago

Unfortunately not.

GuiBBT commented 2 years ago

I have the same issue here with the python version 3.9.15. Seems strange that I'm able to find the instrument with the usb.core.find() but the Keithley driver doesn't find it ...

Anyone figured out how to make connection please ? Spend 2 days on it and still nothing

GuiBBT commented 2 years ago
from keithley2600 import Keithley2600
import usb.core
import pyvisa
import usb.util

dev = usb.core.find()
print("DEVICE FOUND : VID = " + str(dev.idVendor) + "\t\tPID = " + str(dev.idProduct))

print("\nALL USB DEVICES FOUND")
print(usb.core.show_devices())

pyvisa.ResourceManager('@py')
rm = pyvisa.ResourceManager('@py')
print(rm.list_resources())

k = Keithley2600('USB0::0x05E6::0x2634::4106018::INSTR')

With this code I get :

DEVICE FOUND : VID = 1510 PID = 9780 ALL USB DEVICES FOUND DEVICE ID 05e6:2634 on Bus 000 Address 001, Specified at interface ('USB0::1510::9780::4106018\x00::0::INSTR',)

After that the code exit itself. I have to rerun the code in debug mode and launch in the evaluate expression the ligne Keithley2600('USB0::0x05E6::0x2634::4106018::INSTR') to have the error "NoDeviceFound"

GuiBBT commented 2 years ago

Another comment (maybe a dummy one, sry for that), is that normal that when I use debug into the driver functions, the debug exists itself and doesn't end program ? In other files the debug is working well

GuiBBT commented 2 years ago

I guess I found at least why I get "NoDeviceFound" Hopefully it will help others ....

The fast is that when I go in the menu of my Keithley 2634B, in communication I get only "RS232", "LAN" and "GPIB". It seems the USB isn't activated on my SMU so ... can't work of course. I don't get why the USB is present and has a controller inside the SMU (driver installation on windows when plugged) but still, I think that's my issue. I'm going to use GPIB when hardware available

geesk commented 5 months ago

For anyone still looking for way to solve this issue. This worked for me.

k = Keithley2600('USB0::0x05E6::0x2634::4106018::INSTR') to k = Keithley2600('USB0::0x05E6::0x2634::4106018::INSTR'. "")