Skip to main content

Unofficial python wrapper for the PicoScope devices.

Project description

pico-python

Build Status

This is a Python 2.7+ library for the Pico Scope. It uses the provided DLL for actual communications with the instrument. There have been a few examples around, but this one tries to improve on them via:

  • Subclass instrument-specific stuff, so can support more families
  • Use exceptions to raise errors, and gives you nice English error messages (copied from PS Manual)
  • Provide higher-level functions (e.g. just setup timebase, function deals with instrument-specific limitations)
  • Supports both Windows and Linux and Mac

System has support for:

  • PS6000A Class (Picoscope 6xxxE)
  • PS6000
  • PS5000A Class (PicoScope 5242A/5243A/5244A/5442A/5443A/5444A/5242B/5244B/5442B/5443B/5444B)
  • PS4000A Class (PicoScope 4444/4824)
  • PS3000 Class (PicoScope 3204/3205/3206/3224/3424/3425)
  • PS3000A Class (PicoScope 3204A/3204B/3205A/3205B/3206A/3206B/3207A/3207B/3204/3205/3206/3404A/3404B/3405A/3405A/3406A/3406B)
  • PS2000 Class (PicoScope 2104/2105/2202/2203/2204/2205/2204A/2205A)
  • PS2000A Class (PicoScope 2206/2206A/2206B/2207/2207A/2207B/2208/2208A/2208B/2205A MSO/2206B MSO/2207B MSO/2208B MSO/2405A/2406B/2407B/2408B)

Note the 'A' series covers a different ground than the non-A series! Check the programming manuals posted at http://www.picotech.com/document/ for details.

Installation

You need to install the Python module as well as the Picoscope libraries for your Operating system.

Module installation

PyPi

pip install picoscope

Git

If you are developping the library, or need some feature that we haven't pushed to PyPi yet, use git clone to put the directory somewhere. Then use the setup.py script to install the library in development mode:

git clone git@github.com:colinoflynn/pico-python.git
cd pico-python
python setup.py develop

OS specific

Windows

You will require the PicoScope DLLs for this package to work. The easiest method is to install the latest PicoScope software or SDK from https://www.picotech.com/downloads .

Linux

Install the PicoScope Beta for Linux version of PicoScope as describe under Getting DLL's (above). Currently this is the only way to install the shared libraries (SDK)

Once you have PicoScope running you need to add your login account to the pico group in order to access the USB. The examples will crash if you don't have permission to use the USB. This is true for use of the shared libraries in general, even if you're not using pico-python.

useradd -G pico $USER

Mac OSX

You either want to add this every time before you start python or IPython, but I think it is best to add this line to .bash_profile (or the Mac Equivalent ????).

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/PicoScope6.app/Contents/Resources/lib

Recently, this directory has moved to a new location See Issue #143

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/PicoScope 6.app/Contents/Resources/lib"

See Issue 80 for more information on how this was found.

You should also add yourself to the pico group so that your user has access to the picoscope as a USB device

# Create the new pico group :
sudo dseditgroup -o create pico
# Add the current user to the pico group :
sudo dseditgroup -o edit -a $USER -t user pico

Using Anaconda/Conda

Seems like Anaconda has an issue with ctypes. See the comment here imdatacenters says to:

If you are using a special version of Python [like Anaconda] and you can't fix it. Navigate to line 362 of lib/ctypes/init.py and change it to: self._handle = _dlopen(str(self._name), mode)

Similar Projects

PicoPy uses Cython to interface with a PicoScope 3000A https://github.com/hgomersall/PicoPy

Picoscope offers their official wrappers, https://github.com/picotech/picosdk-python-wrappers

Authors, Copyright, and Thanks

pico-python is Copyright (C) 2013 By:

All rights reserved. See LICENSE.md for license terms.

Inspired by Patrick Carle's code at http://www.picotech.com/support/topic11239.html which was adapted from http://www.picotech.com/support/topic4926.html

Contributing

  1. Fork.
  2. Make a new branch.
  3. Commit to your new branch.
  4. Add yourself to the authors/acknowledgments (whichever you find appropriate).
  5. Submit a pull request.

Alternatively, you can follow more thorough instructions here.

Developer notes

Commit and create a new tag with git

git commit
git tag -a X.Y.Z -m "Short descriptive message"

Push the tags to the repo

git push origin X.Y.Z

or to push all tags

git push --tags

versioneer takes care of updating the version. New tags will be pushed to PyPi automatically by Travis.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picoscope-0.7.22.tar.gz (81.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

picoscope-0.7.22-py3-none-any.whl (86.9 kB view details)

Uploaded Python 3

File details

Details for the file picoscope-0.7.22.tar.gz.

File metadata

  • Download URL: picoscope-0.7.22.tar.gz
  • Upload date:
  • Size: 81.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for picoscope-0.7.22.tar.gz
Algorithm Hash digest
SHA256 62decd77e191a24b4c391a18d4ee2943f056a7a04ebc48847c8d8f9638e5b5d5
MD5 7c0e53950ccb3bd3d6410f6c2f0932a7
BLAKE2b-256 9fa01baee6c94c0351156b059eb94a7cf29b3e3db95fc5878da8131a51ca6aad

See more details on using hashes here.

File details

Details for the file picoscope-0.7.22-py3-none-any.whl.

File metadata

  • Download URL: picoscope-0.7.22-py3-none-any.whl
  • Upload date:
  • Size: 86.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for picoscope-0.7.22-py3-none-any.whl
Algorithm Hash digest
SHA256 25a25c650532bd3bc92762f07664f05cf074fb543f2983b416956c700c0ed741
MD5 92df09121225d946c23229808a4b8cfe
BLAKE2b-256 9d076cdbb10461a76e68f65280208eb042756b1103e228b9c5273127e41c2578

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page