pyvisa / pyvisa-py

A pure python PyVISA backend

Home Page:https://pyvisa-py.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[COM] Communication issue with XXX using XXX

dhunganaanish opened this issue · comments

Instrument details

  • Model:
  • Communication: TCPIP, GPIB, ....
  • Link to the documentation (if available):

Output of pyvisa-info

Model: keysight 33600A waveform generator
Communication: USB

Code:
from future import print_function
import pyvisa
from keysight_33600a import keysight_33600a
pyvisa.log_to_screen()
rm = pyvisa.ResourceManager('@py')
rm.list_resources()
inst = rm.open_resource('USB0::0x0957::0x5707::MY53803283::INSTR')
print(inst.query("*IDN?"))

Result:
2022-11-04 10:45:48,535 - pyvisa - DEBUG - SerialSession was correctly imported.
2022-11-04 10:45:48,637 - pyvisa - DEBUG - USBSession and USBRawSession were correctly imported.
2022-11-04 10:45:48,646 - pyvisa - DEBUG - TCPIPSession was correctly imported.
2022-11-04 10:45:48,650 - pyvisa - DEBUG - GPIBSession was not imported No module named 'gpib'.
2022-11-04 10:45:48,650 - pyvisa - DEBUG - Created library wrapper for py
2022-11-04 10:45:48,650 - pyvisa - DEBUG - Created ResourceManager with session 3281506
2022-11-04 10:45:48,683 - pyvisa - DEBUG - USB0::0x0957::0x5707::MY53803283::0::INSTR - opening ...
Traceback (most recent call last):
File "C:\Users\aanis\OneDrive\Documents\python\frequency_sweep\keysight_33600a_sr830.py", line 7, in
inst = rm.open_resource('USB0::0x0957::0x5707::MY53803283::INSTR',)
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa\highlevel.py", line 3284, in open_resource
res.open(access_mode, open_timeout)
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa\resources\resource.py", line 278, in open
self.session, status = self._resource_manager.open_bare_resource(
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa\highlevel.py", line 3209, in open_bare_resource
return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa_py\highlevel.py", line 167, in open
sess = cls(session, resource_name, parsed, open_timeout)
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa_py\sessions.py", line 325, in init
self.after_parsing()
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa_py\usb.py", line 81, in after_parsing
self.interface = self._intf_cls(
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa_py\protocols\usbtmc.py", line 287, in init
super(USBTMC, self).init(vendor, product, serial_number, **kwargs)
File "C:\Users\aanis\anaconda3\lib\site-packages\pyvisa_py\protocols\usbtmc.py", line 202, in init
raise ValueError(
ValueError: 2 devices found:
DEVICE ID 0957:5707 on Bus 000 Address 010 =================
bLength : 0x12 (18 bytes)
bDescriptorType : 0x1 Device
bcdUSB : 0x200 USB 2.0
bDeviceClass : 0x0 Specified at interface
bDeviceSubClass : 0x0
bDeviceProtocol : 0x0
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0x0957
idProduct : 0x5707
bcdDevice : 0x100 Device 1.0
iManufacturer : 0x4 Keysight Technologies
iProduct : 0x5 33622A
iSerialNumber : 0x6 MY53803283
bNumConfigurations : 0x1
CONFIGURATION 1: 0 mA ====================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x45 (69 bytes)
bNumInterfaces : 0x2
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0xc0 Self Powered
bMaxPower : 0x0 (0 mA)
INTERFACE 0: Application Specific ======================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x3
bInterfaceClass : 0xfe Application Specific
bInterfaceSubClass : 0x3
bInterfaceProtocol : 0x1
iInterface : 0x0
ENDPOINT 0x81: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x2: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x2 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x83: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x83 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x2 (2 bytes)
bInterval : 0x1
INTERFACE 1: Vendor Specific ===========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x1
bAlternateSetting : 0x0
bNumEndpoints : 0x3
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
ENDPOINT 0x85: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x85 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x4: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x4 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x87: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x87 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x4
DEVICE ID 0957:5707 on Bus 000 Address 011 =================
bLength : 0x12 (18 bytes)
bDescriptorType : 0x1 Device
bcdUSB : 0x200 USB 2.0
bDeviceClass : 0x0 Specified at interface
bDeviceSubClass : 0x0
bDeviceProtocol : 0x0
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0x0957
idProduct : 0x5707
bcdDevice : 0x100 Device 1.0
iManufacturer : 0x4 Keysight Technologies
iProduct : 0x5 33622A
iSerialNumber : 0x6 MY53803283
bNumConfigurations : 0x1
CONFIGURATION 1: 0 mA ====================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x27 (39 bytes)
bNumInterfaces : 0x1
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0xc0 Self Powered
bMaxPower : 0x0 (0 mA)
INTERFACE 0: Application Specific ======================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x3
bInterfaceClass : 0xfe Application Specific
bInterfaceSubClass : 0x3
bInterfaceProtocol : 0x1
iInterface : 0x0
ENDPOINT 0x81: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x2: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x2 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0x0
ENDPOINT 0x83: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x83 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x2 (2 bytes)
bInterval : 0x1
Please narrow the search criteria
2022-11-04 10:45:48,720 - pyvisa - DEBUG - Closing ResourceManager (session: 3281506)
[Finished in 0.787s]