colinoflynn / pico-python

PicoScope Python Interface
Other
97 stars 78 forks source link

CM3 Support #93

Open ochoadavid opened 7 years ago

ochoadavid commented 7 years ago

Hi! I'm trying to use a CM3 Current Data Logger from a linux server. Is there any plans to add support for it in pico-python?

I'm willing to code it (or at least help!), but I'm not sure how to start. Can someone give me advice?

David

hmaarrfk commented 7 years ago

Hey David,

Thanks for being interested.

Just to make sure you aren't duplicating work, have you tried the official picoscope python library? I'm taking away loyal followers from this git repo, but I think picoscope has since started to support python to a certain extent.

In either case, it seems that the dataloggers have at most 15 functions, compared to the 40+ for regular scopes. They seem pretty different. But some are similar and should give you a hang of the programming style we have chosen.

You should look for the programming manual on their website.

Honestly though, all this organization is just fancy stuff. Try to get the OpenUnit, CloseUnit, PLCM3GetUnitInfo functions up and running. The code should be nearly identical.

For the final product, I would create maybe 2 python files: picolog.py and maybe a file called picologcm3.py These would be akin to picoscope.py and ps6000.py in our current code and would have similar imports.

The way we organized things is to have picoscope.py have no knowledge of C datatypes. This means that the _lowLevelOpenUnit converts python to C. This is mostly done so that the file picoscope.py can follow "Python conventions" and the _lowLevel functions are free to break all Pythonic rules.

Fork the repo, and create a new branch, I can help you with bugs you encounter along the way and finally merge things into this one. The dataloggers seem pretty separate, I won't really worry if you have too many stylistic differences.

ochoadavid commented 7 years ago

Hi Mark!

Thank you for your response.

I'm haven't been able to find any official python library. It seems that there is some ongoing work on the forums but I think that this one is the most advanced yet.

Anyway I wasn't aware of those programing manuals and with that info I will try to implement some functions.

Thanks again, and hopefully will be back here soon to merge, David Ochoa

hmaarrfk commented 6 years ago

Hi David Ochoa,

I'm glad that those links were of use to you.

Yeah, typically, manufacturers don't have enough time to develop the libraries into a "pythonic" way. This is what we aimed to do here.

Anyway, it would be interesting to see what you were able to do with the data logger and python. If it follows our same style, I would be glad to pull them in.

If you decided to take your own direction in terms of coding style and libraries used, I could at the very least point to your repository.

Let me know.