-
Notifications
You must be signed in to change notification settings - Fork 78
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
USB powered picoscope 5000a #44
Comments
What error specifically? Haven't used the picoscope for a while, so I'm not exactly fresh on all the little quirks. |
Are you using a ps544x? I haven't had the issue myself, but maybe you've /****************************************************************************************
switch (status) } case PICO_POWER_SUPPLY_CONNECTED: case PICO_POWER_SUPPLY_UNDERVOLTAGE: Maybe a python version of that is what you need? On Thu, Apr 14, 2016 at 10:59 AM, Mark Harfouche notifications@github.com
|
It's the Ps5242a. The error is PICO_POWER_SUPPLY_NOT_CONNECTED. Yes as you say morgatron, I need to use the function ps5000aChangePowerSource. I'm not quite sure why they say it only applies to the PS544xa series. The error is in checkResult in picobase.py and there is a note mentioning this. what would be the best way to implement this function - add it to picobase or the picoscope5000a class? Cheers |
Our general strategy has been the following: Add all the logic and "default parameter" settings to the picobase. The picobase should NOT have ctypes. the ps5000a class should simply convert from python datatypes to ctypes as much as possible. Generally: for example
allows you to set a channel either by letter "B" or by number int(1). We don't check for out of bound integers because the driver will do that for you. Once you have done things that you call your _lowLevel function that calls the appropriate function in the dll. The picobase does not have access to the dll, nor should it. I'll try to write this up nicely some time. Thanks for helping make this library better! |
i know it's been a while since i raised this issue, however the solution that i have been using its to add
between I'm think that this should be within the ps500a class as not all picoscopes can be powered by USB. |
Can you try the branch ps5000aChangePowerSource I was hesitant to inject the code in the open function, but I think that is a fair thing to do. See the 3 locations were code was changed:
|
Let me know if this fixes things, I will push it to the master branch if it does |
I just tried this, had a few bug-fixes (commited). I wasn't sure on the RV for the function how it was supposed to work. But it doesn't work for me - I get an error that the PICO is not responding to USB commands inside of the call to changePowerState(). Not sure if it's just a hardware setup issue on my side though. |
Sorry about the RV. I forgot we were being pythonic and didn't actually return error codes from the picoscope class. My commit removes the RV. Thanks for placing the handle at the correct location. It should be pretty easy to test, just connect the scope to the USB, nothing else. The USB cable should be a good one though, maybe the one supplied by picotech, else there might be a big voltage drop from the computer to the scope. |
Gotcha thanks - your code looks more reasonable! Fixed a small typo + error reporting problem and it works for me I think now. My original problem was indeeed a crappy USB cable :/ |
Hmm strange. Which picoscope are you using it on Colin? I do agree that implementing the change power source function by default isn't pretty and could potentially hide other bugs. Would it possibly make sense to add a parameter to _lowLevelOpenUnit that by default is set to use DC power but could be set by a user for USB power. Then an if function after ps5000aOpenUnit can change the power source if the parameter is set to USB? |
Has anyone got a way to avoid the error when the picoscope is powered from USB rather than from the power supply?
The text was updated successfully, but these errors were encountered: