-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to find connected devices #858
Comments
P/S Here is the output from pyvisa-info Machine Details: Python: PyVISA Version: 1.14.1 Backends: |
We can go on from there |
Thank you, here is the output Resource Manager of Visa Library at py |
Permissions is part of it, here it is again with sudo sudo ./SPD1000x.py |
Have a look at this comment: #758 (comment) I’ll try to pick up pyvisa/pyvisa-py#423 soon unless somebody else does it, there’s minimal changes + docs to be done. |
Although I just noticed the null bytes in the address generated from root — that’s a bit odd. |
The first comment, got use past the permissions for the listing, here is where we are now, without sudo. Resource Manager of Visa Library at py |
Here is some progress: #!/usr/bin/python #JAC: 03/31/2020 import pyvisa def main(): if name == 'main': And here is the output ./SPD1000x.py |
Notice it is hung after the second list_resources. So, take out the read termination, and voila, we get an answer. It is incredibly slow, but it answers. #!/usr/bin/python #JAC: 03/31/2020 import pyvisa def main(): if name == 'main': Resource Manager of Visa Library at py |
Can you please check if your instrument’s firmware is up to date? See https://int.siglent.com/download/firmwares/?ProId=28 That output also does not look too hot, it is not complete, which might lead to issues reading subsequent responses. |
Okay, that gets me going. Thank you. Maybe some more detail on installation would help. |
Here is the recipe
And here is a rules with a few devices
|
@drmcnelson @arr-ee feel free to suggest improvement to pyvisa-py documentation regarding proper configuration of USBTMC devices. There is room for improvement but I have too little first hand experience there to make any substantial change. |
@MatthieuDartiailh yeah I’ll pick up the PR mentioned above and will update docs since it is a requirement for the PR to make sense. |
Attempting to communicate with Siglent SPD1000x
list_resources() returns nothing.
open fails.
Following are
(a) the output from lsusb -v
(b) a sample program, downloaded from here or siglent (i forget which) with some added diagnostics
(c) the stack trace from the program
lsusb output
Bus 001 Device 009: ID f4ec:1410 Atten Electronics / Siglent Technologies SPD1000X
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown]
bDeviceSubClass 0 [unknown]
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0xf4ec Atten Electronics / Siglent Technologies
idProduct 0x1410 SPD1000X
bcdDevice 1.00
iManufacturer 1 Siglent
iProduct 2 SPD1000X
iSerial 3 SPD13DCC8R0195
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 3 Test and Measurement
bInterfaceProtocol 1 TMC
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
sample program
#JAC: 03/31/2020
#-Added \n to write and read terminations
import pyvisa
import time # for sleep
import binascii
def main():
rm = pyvisa.ResourceManager()
print( 'list resources' )
rm.list_resources()
print( 'instadd')
instadd = 'USB0::0xF4EC::0x1410::SPD13DCC8R0195::INSTR'
print( 'open')
inst = rm.open_resource(instadd)
inst.write_termination='\n'
inst.read_termination='\n'
print (rm.list_resources())
time.sleep(0.04)
inst.write('OUTP CH1,ON')
time.sleep(2)
inst.write('OUTP CH1,OFF')
time.sleep(2)
inst.write('*IDN?')
#print ("here")
time.sleep(1)
qStr = inst.read()
print (str(qStr))
inst.close()
if name == 'main':
main()
output and stack trace
list resources
instadd
open
Traceback (most recent call last):
File "/home/datacollection/TeensyDataAcquistion/Python_Programs_240927/./SPD1000x.py", line 35, in
main()
File "/home/datacollection/TeensyDataAcquistion/Python_Programs_240927/./SPD1000x.py", line 18, in main
inst = rm.open_resource(instadd)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyvisa/highlevel.py", line 3292, in open_resource
res.open(access_mode, open_timeout)
File "/usr/local/lib/python3.12/site-packages/pyvisa/resources/resource.py", line 281, in open
self.session, status = self._resource_manager.open_bare_resource(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyvisa/highlevel.py", line 3217, in open_bare_resource
return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyvisa_py/highlevel.py", line 168, in open
sess = cls(session, resource_name, parsed, open_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyvisa_py/sessions.py", line 322, in init
self.after_parsing()
File "/usr/local/lib/python3.12/site-packages/pyvisa_py/usb.py", line 82, in after_parsing
self.interface = self._intf_cls(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyvisa_py/protocols/usbtmc.py", line 307, in init
super(USBTMC, self).init(vendor, product, serial_number, **kwargs)
File "/usr/local/lib/python3.12/site-packages/pyvisa_py/protocols/usbtmc.py", line 202, in init
raise ValueError("No device found.")
ValueError: No device found.
The text was updated successfully, but these errors were encountered: