(Python) AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'

Post general discussions on using our drivers to write your own software here
Post Reply
dmerthe
Newbie
Posts: 0
Joined: Fri Apr 15, 2022 4:16 pm

(Python) AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'

Post by dmerthe »

Hello,

I am trying to set up communication with a 2204A, using Python 3.9 (64 bit) on Windows. I downloaded and installed the 64 bit PicoSDK, and I installed the GitHub python wrapper repo (https://github.com/picotech/picosdk-python-wrappers).

Following the Readme in that repo, I tried executing the verification code:

Code: Select all

from picosdk.discover import find_all_units

scopes = find_all_units()

for scope in scopes:
    print(scope.info)
    scope.close()
The import goes fine, but on the defintion of scopes it throws the error,

Code: Select all

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\Daniel Merthe\AppData\Local\Programs\Python\Python39\lib\site-packages\picosdk\discover.py", line 46, in find_all_units
    device = driver.open_unit()
  File "C:\Users\Daniel Merthe\AppData\Local\Programs\Python\Python39\lib\site-packages\picosdk\library.py", line 134, in open_unit
    return Device(self, self._python_open_unit(serial=serial, resolution=resolution))
  File "C:\Users\Daniel Merthe\AppData\Local\Programs\Python\Python39\lib\site-packages\picosdk\library.py", line 146, in _python_open_unit
    handle, status = self._python_open_any_unit(resolution)
  File "C:\Users\Daniel Merthe\AppData\Local\Programs\Python\Python39\lib\site-packages\picosdk\library.py", line 163, in _python_open_any_unit
    resolution = self.DEFAULT_RESOLUTION
AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'
Is this a true bug, or did I miss something in the installation?

Any help would be greatly appreciated.

dmerthe
Newbie
Posts: 0
Joined: Fri Apr 15, 2022 4:16 pm

Re: (Python) AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'

Post by dmerthe »

Update 20 April 2022:

After digging around the code in the repository, I find no mention or assignment of the DEFAULT_RESOLUTION attribute of Ps6000alib (class defined in picosdk/ps6000a.py). So, it must be defined at a lower level, which I am not comfortable playing around with.

I installed a second 2204A on a Linux system (w/ Python 3.7) and ran into the same error, so it is not a driver installation error on my part.

However, I found that everything works fine if line 22 in discover.py is commented out (see attached image). This indicates that the implementation (at the driver level?) of the 6000A series of oscilloscopes is different from the other series in a way that conflicts with how this Python library generally handles them.
Attachments
Comment Line 22.png

ted-span
Newbie
Posts: 0
Joined: Tue Jun 06, 2023 12:33 am

Re: (Python) AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'

Post by ted-span »

I am expereincing the same error in 2023.
picosdk v1.1 on python v3.10.5

Post Reply