# 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](https://www.picotech.com/downloads) 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](https://www.picotech.com/downloads/linux)
to install the required driver packages for your product.
### macOS
Please visit [our Downloads page](https://www.picotech.com/downloads) to download the PicoSDK C Libraries for MacOS.
## Installing the python driver bindings
A `distutils` installer is provided. After you have installed the PicoSDK
driver package (see above), the Python package can be installed using the
following command in the top-level directory:
pip install .
If you are not using a virtualenv or are not elevated, use:
python setup.py install
=======
For using the AS108 you will need to use the following as well:
python setupPicosynth.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:
pip 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](https://www.picotech.com/tech-support), 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](https://github.com/picotech/picosdk-python-wrappers#programmers-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](https://www.picotech.com/library/documentation).
## 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](https://github.com/picotech/picosdk-python-wrappers#unsupported-models),
let us know that you're waiting in an [Issue](https://www.picotech.com/tech-support)
### 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
### Dependencies
As well as depending on the C libraries, the Python 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. These examples are currently not being developed further but are still avaliable to use
and develop futher yourself.
### 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](https://www.picotech.com/tech-support) to contact us directly or visit our [Test and Measurement Forum](https://www.picotech.com/support/forum17.html) to post questions.
## Copyright and licensing
See [LICENSE.md](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.
没有合适的资源?快使用搜索试试~ 我知道了~
picosdk-python-wrappers-master.zip
共112个文件
py:102个
md:6个
txt:2个
需积分: 0 0 下载量 192 浏览量
2023-11-28
09:28:41
上传
评论
收藏 214KB ZIP 举报
温馨提示
Welcome to the PicoSDK for Python. It allows you to control PicoScope devices in your own Python programs.
资源推荐
资源详情
资源评论
收起资源包目录
picosdk-python-wrappers-master.zip (112个子文件)
.gitignore 265B
README.md 6KB
CODE_OF_CONDUCT.md 3KB
CONTRIBUTING.md 911B
LICENSE.md 741B
issue_template.md 561B
PULL_REQUEST_TEMPLATE.md 56B
ps4000a.py 38KB
ps5000a.py 36KB
ps3000a.py 32KB
ps6000a.py 30KB
ps2000a.py 30KB
ps6000.py 30KB
library.py 28KB
ps4000.py 27KB
ps5000.py 16KB
constants.py 15KB
ps5000aRapidBlockExample.py 14KB
ps3000aRapidBlockExample.py 14KB
ps6000RapidBlockTriggerTimestampExample.py 13KB
ps2000.py 13KB
ps2000aMSOBlockExample.py 13KB
ps2000aRapidBlockExample.py 13KB
ps6000RapidBlockExample.py 13KB
ps3000.py 12KB
device.py 12KB
ps5000RapidBlockExample.py 11KB
ps6000aRapidBlockExample.py 10KB
ps4000aRapidBlockExample.py 10KB
usbDrDaq.py 9KB
PicoDeviceEnums.py 9KB
ps4000aBlockDropoutTriggerExample.py 8KB
ps5000aBlockMSOTriggerExample.py 8KB
ps5000aStreamingExample.py 8KB
ps4824BlockExample.py 8KB
ps3000aBlockAdvancedTriggerExample.py 8KB
ps3000aStreamingExample.py 8KB
ps4000aStreamingExample.py 8KB
ps5000aBlockAdvancedTriggerExample.py 7KB
ps6000BlockAdvancedTriggerExample.py 7KB
ps2000aStreamingExample.py 7KB
ps2000aBlockExampleCallbackMethod.py 7KB
ps2000aBlockExample.py 7KB
ps2000aSigGen.py 7KB
ps6000StreamingExample.py 7KB
test_timebase.py 7KB
ps6000aBlockAdvancedTriggerExample.py 7KB
ps5000aBlockCallbackExample.py 7KB
ps6000aBlockMSOExample.py 7KB
ps4444BlockExample.py 7KB
ps3000aBlockMSOExample.py 7KB
ps5000aBlockExample.py 7KB
ps4000StreamingExample.py 7KB
ps5000aBlockMSOExample.py 7KB
ps6000aStreamingModeExample.py 6KB
ps5000BlockExample.py 6KB
picosynth.py 6KB
ps6000BlockExample.py 6KB
ps4000BlockExample.py 6KB
functions.py 6KB
ps3000aBlockExample.py 5KB
picohrdl.py 5KB
pl1000.py 5KB
trigger_read_wpwq.py 5KB
trigger_read_runt.py 5KB
ps6000aBlockExample.py 5KB
trigger_read_pwq.py 5KB
ps2000ETSBlockExample.py 5KB
PicoDeviceStructs.py 5KB
trigger_read_dropout.py 5KB
ps5000aSigGen.py 5KB
ps4000aSigGen.py 5KB
trigger_read_interval.py 5KB
trigger_read_window.py 5KB
usbtc08.py 5KB
ps2000BlockExample.py 4KB
ps3000aSigGen.py 4KB
test_open_close_unit.py 4KB
usbPT104.py 4KB
test_get_unit_info.py 4KB
ps6000SigGen.py 3KB
ps6000aSigGenExample.py 3KB
streaming_mode_polling.py 3KB
usbdrdaqScopeBlockExample.py 3KB
streaming_mode_gathering.py 3KB
test_set_channel.py 3KB
usbdrdaqPhBlockExample.py 3KB
block_read.py 3KB
test_discover.py 2KB
pl1000StreamingModeExample.py 2KB
streaming_mode_threaded.py 2KB
streaming_mode.py 2KB
test_helpers.py 2KB
pt104Example.py 2KB
tc08StreamingModeExample.py 2KB
picosynthFrequencySweepExample.py 2KB
setup.py 2KB
tc08SingleModeExample.py 2KB
discover.py 1KB
errors.py 1KB
共 112 条
- 1
- 2
资源评论
SandyXIN
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功