pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
288 stars 124 forks source link

PyVisa-py not listing USB Devices #152

Closed TaakoMagnusen closed 6 years ago

TaakoMagnusen commented 6 years ago

Here is my pyvisa-info:

Machine Details:
   Platform ID:    Windows-10-10.0.16299-SP0
   Processor:      Intel64 Family 6 Model 79 Stepping 1, GenuineIntel

Python:
   Implementation: CPython
   Executable:     c:\users\localuser\appdata\local\continuum\anaconda3\envs\visaenv\python.exe
   Version:        3.6.5
   Compiler:       MSC v.1900 64 bit (AMD64)
   Bits:           64bit
   Build:          Apr  6 2018 16:13:55 (#default)
   Unicode:        UCS4

PyVISA Version: 1.10.0.dev0

Backends:
   ni:
      Version: 1.10.0.dev0 (bundled with PyVISA)
      Binary library: Not found
   py:
      Version: 0.3.dev0
      ASRL INSTR: Available via PySerial (3.4)
      USB INSTR: Available via PyUSB (1.0.2). Backend: libusb0
      USB RAW: Available via PyUSB (1.0.2). Backend: libusb0
      TCPIP INSTR: Available
      TCPIP SOCKET: Available
      GPIB INSTR:
         Please install linux-gpib to use this resource type.
         No module named 'gpib'

Currently i have a National Instruments USB-6363 connected, and it is seen in Device Manager under lib-usbwin32 Devices

In addition when i run the following code:

>>> import usb.core
>>> usb.core.find()

The output shows the device:

DEVICE ID 3923:74fe on Bus 000 Address 001 =================
 bLength                :   0x12 (18 bytes)
 bDescriptorType        :    0x1 Device
 bcdUSB                 :  0x200 USB 2.0                                                                                 bDeviceClass           :   0xff Vendor-specific
 bDeviceSubClass        :    0x0
 bDeviceProtocol        :    0x0
 bMaxPacketSize0        :   0x40 (64 bytes)
 idVendor               : 0x3923
 idProduct              : 0x74fe
 bcdDevice              :    0x1 Device 0.01
 iManufacturer          :    0x1 National Instruments
 iProduct               :    0x2 USB-6363
 iSerialNumber          :    0x3 16998D4
 bNumConfigurations     :    0x1
  CONFIGURATION 1: 0 mA ====================================
   bLength              :    0x9 (9 bytes)
   bDescriptorType      :    0x2 Configuration
   wTotalLength         :   0x97 (151 bytes)
   bNumInterfaces       :    0x1
   bConfigurationValue  :    0x1
   iConfiguration       :    0x0
   bmAttributes         :   0xc0 Self Powered
   bMaxPower            :    0x0 (0 mA)
    INTERFACE 0: Vendor Specific ===========================
     bLength            :    0x9 (9 bytes)
      ....

Thus i know the device is seen by PyUSB.

But when i do the following:

import visa

#Configure Backend
rm = visa.ResourceManager('@py')
print(rm.list_resources())

All i see is: ('ASRLCOM3::INSTR', 'ASRLCOM1::INSTR') Which is just some generic intel COM controllers on my machine.

I also tried

rm = visa.ResourceManager('@py')
print(rm.list_resources(query='?*'))

but the same result appears.

Additionally the same result appears when i use the standard back-end

MatthieuDartiailh commented 6 years ago

See my answer in https://github.com/pyvisa/pyvisa/issues/350