All Projects → picotech → Picosdk Python Wrappers

picotech / Picosdk Python Wrappers

Licence: isc
A set of Python bindings and examples for PicoScope® oscilloscope and PicoLog® data logger products.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects
python2
120 projects

Projects that are alternatives of or similar to Picosdk Python Wrappers

Sxkdvm
SXKDVM - OSX Docker KVM / Run an OSX KVM virtual machine inside a Docker container.
Stars: ✭ 840 (+990.91%)
Mutual labels:  macosx
Engraver
PoCC Burstcoin Reference Plotter
Stars: ✭ 61 (-20.78%)
Mutual labels:  macosx
Qtfm
Qt File Manager
Stars: ✭ 73 (-5.19%)
Mutual labels:  macosx
Macscripts
the place I put the scripts I write for my mac fleet
Stars: ✭ 32 (-58.44%)
Mutual labels:  macosx
Syncthing Macos
Frugal and native macOS Syncthing application bundle
Stars: ✭ 1,096 (+1323.38%)
Mutual labels:  macosx
Alchemy
An open drawing project
Stars: ✭ 63 (-18.18%)
Mutual labels:  macosx
Free
Memory usage for macos, an alternative to free command.
Stars: ✭ 18 (-76.62%)
Mutual labels:  macosx
Archivemounter
Mounts archives like disk images (macOS)
Stars: ✭ 77 (+0%)
Mutual labels:  macosx
Macos Setup
A curated macOS setup | v2
Stars: ✭ 60 (-22.08%)
Mutual labels:  macosx
Subethaedit
General purpose plain text editor for macOS. Widely known for its live collaboration feature.
Stars: ✭ 1,183 (+1436.36%)
Mutual labels:  macosx
Android File Transfer Linux
Android File Transfer for Linux
Stars: ✭ 994 (+1190.91%)
Mutual labels:  macosx
Skybar Deeplink
Mac app that add to the menu bar deep link tool so you can easily open your deep links in your installed simulator.
Stars: ✭ 50 (-35.06%)
Mutual labels:  macosx
Ruby Vmstat
A focused and fast library to gather memory, cpu, network, load avg and disk information
Stars: ✭ 68 (-11.69%)
Mutual labels:  macosx
Ios Cmake
A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
Stars: ✭ 844 (+996.1%)
Mutual labels:  macosx
Rhea
A Mac status bar app for quickly sharing files and links.
Stars: ✭ 73 (-5.19%)
Mutual labels:  macosx
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-67.53%)
Mutual labels:  macosx
Menubarosxapp
Generic Mac OS X menu bar app (agent) template
Stars: ✭ 63 (-18.18%)
Mutual labels:  macosx
Codechecker
CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
Stars: ✭ 1,209 (+1470.13%)
Mutual labels:  macosx
Macos Virtualbox Vm
A preconfigured macOS VirtualBox VM and bootable installer creation script
Stars: ✭ 74 (-3.9%)
Mutual labels:  macosx
Electron
This is the repository for my course, Electron: Building Cross Platform Desktop Apps on LinkedIn Learning and Lynda.com.
Stars: ✭ 69 (-10.39%)
Mutual labels:  macosx

picosdk-python-wrappers

Welcome to the PicoSDK for Python. It allows you to control PicoScope devices in your own Python programs.

Getting started

To use this code you will need to install the PicoSDK C libraries.

Microsoft Windows

Please visit our Downloads page to download the 32-bit or 64-bit PicoSDK C Libraries for Windows. Please take care to match the "bitness" of your python to the PicoSDK.

Linux

Follow the instructions from our Linux Software & Drivers for Oscilloscopes and Data Loggers page to install the required driver packages for your product.

macOS

macOS users should install PicoScope Beta for macOS, and then may find this forum post helpful for installing the C libraries.

Installing the python driver bindings

A distutils installer is provided. After you have installed the PicoSDK driver package (see above), the Python installer can be used as follows:

python setup.py install

On macOS and Linux you will either need to use sudo with this command, to install into the system folders, or to install for the current user only you can use:

python setup.py install --user

Within python, the library for import is called picosdk.

Compatibility

This code is written to be compatible with both python 2.7 and python 3 (any version).

If you find a compatibility problem please raise an Issue, listing all the versions you can find (python, numpy, picosdk commit hash, etc.) and your error message(s).

C interface

You can access C driver functions directly (ctypes calls) by their original C name, following the Programmer's Guides exactly. Examples are provided in the folders like psX000[a]Examples/.

Programmer's Guides

You can download Programmer's Guides providing a description of the API functions for the relevant PicoScope or PicoLog driver from our Documentation page.

Python interface

We are in the process of adding Pythonic wrappers around the C functions. If we haven't got to your feature yet or your device is listed as one of the unsupported models, let us know that you're waiting in an Issue

Unsupported models

The following drivers and devices are not yet supported:

  • plcm3 - PicoLog CM3 Current Data Logger
  • ps3000 - PicoScope 3204, 3205, 3206, 3223, 3224, 3423 & 3423
  • usbpt104 - PT-104 Platinum Resistance Data Logger

Dependencies

As well as depending on the C libraries, the Pythonic wrappers use some python libraries like numpy. Many of the examples scripts also use the matplotlib plotting library. You can install these dependencies with pip as follows:

pip install -r requirements.txt
pip install -r requirements-for-examples.txt

Driver-agnostic examples

The anyScopeExamples folder contains examples in pure python which do the same thing as the C-style examples, but in a driver-generic way.

Python Classes

Library

picosdk.library.Library contains a base class for each of the driver classes. It does the job of translating python types into C ones, and back again, and some unit conversions to get rid of nano, micro and milli-style prefixes. It also handles any differences in programming API between PicoScope driver versions.

Device

picosdk.device.Device contains the concrete class which represents a PicoScope with a valid handle. It caches some information about the device state, like the currently selected voltage ranges of the channels.

It is implemented in terms of the Library class' public interface, and deals almost entirely with python types. The main exception is its handling of numpy arrays - it (knowing the voltage ranges) is responsible for converting the raw ADC counts that the driver uses for amplitude into physical units.

Testing this code

Check which device driver your device uses, and check the constants at the top of test/test_helpers.py to enable the relevant drivers for connected-device tests. (most tests use this).

To check which driver your device uses, you can use picosdk.discover:

from picosdk.discover import find_all_units

scopes = find_all_units()

for scope in scopes:
    print(scope.info)
    scope.close()

You should then configure test/test_helpers.py's list of connected devices, so it can run all the tests we have on your device.

To run the unit tests, you will need to install nose (e.g. pip install nose.) Then, run nosetests in the root of the repo.

Obtaining support

Please visit our Support page to contact us directly or visit our Test and Measurement Forum to post questions.

Copyright and licensing

See LICENSE.md for license terms.

PicoScope, PicoLog and PicoSDK are registered trademarks of Pico Technology Ltd.

Windows is a registered trademark of Microsoft Corporation.

macOS is a registered trademark of Apple Inc.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Copyright © 2018-2019 Pico Technology Ltd. All rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].