P2PlantAccess
Access to process variable of a P2Plant.
Demo
Start simulatedADCs plant as discribed in the P2Plant module:
Start the client:
python3 -m p2plantaccess.simulatedADCs -k -g
A dynamic plot should appear with 8 sawtooth curves.
Example of Python interaction with simulatedADCs
Have the simulatedADCs plant running.
from p2plantaccess import Access as pa
pa.init()
pa.start()
pa.request(["info", ["*"]])
{'*': {'version': 'MCU and software version, system clock', 'debug': 'Show debugging messages', 'run': 'For experts. Start/Stop board peripherals except ADCs', 'sleep': 'Sleep in the program loop', 'perf': 'Performance counters. TrigCount, RPS in main loop', 'adc_offsets': 'Offsets of all ADC channels', 'adc_reclen': 'Record length. Number of samples of each ADC', 'adc_srate': 'Sampling rate of ADCs', 'adc': 'Two-dimentional array[adc#][samples] of ADC samples'}}
pa.request(["get", ["version"]])
{'version': {'v': 'MCU: STM32G431, soft:0.2.0 2025-02-02, clock:170000000,baudrate:7372800', 't': (1738803674, 976149845)}}
# Get info on run and sleep PVs:
pa.request(['info', ['run','sleep']])
{'run': {'desc': 'For experts. Start/Stop board peripherals except ADCs', 'type': 'char*', 'shape': [1], 'fbits': 'WRDsrE', 'legalValues': 'start,stop'}, 'sleep': {'desc': 'Sleep in the program loop', 'type': 'uint32', 'shape': [1], 'fbits': 'R', 'units': 'ms', 'opLow': 0, 'opHigh': 10000}}
pa.request(["get", ["run"]])
{'run': {'v': 'start', 't': (1738803674, 976150227)}}
pa.request(['set', [('run','stop')]])
{}
pa.request(["get", ["run"]])
{'run': {'v': 'stop', 't': (1738803674, 976150227)}}
pa.request(['get', ['adc']])
{'adc': {'shape': [8, 80], 'v': array([[
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]],
dtype=uint16), 't': (1738803674, 976151047)}}
Metadata
Release files for p2plantaccess 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| p2plantaccess-1.0.4.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| p2plantaccess-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.7 kB
Release files / p2plantaccess-1.0.4.tar.gz
| Download URL | p2plantaccess-1.0.4.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d02170f1fcaca6e5b6802b5e34d51857b1ff392aeabf5fdb0ddea1eb2d96c989
|
|
BLAKE2b-256 checksum How to use checksums |
c125ee7807430bccdde497e0840524bd9856b34caad03ce79b31955c908f0735
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / p2plantaccess-1.0.4-py3-none-any.whl
| Download URL | p2plantaccess-1.0.4-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89d41eacc4842076148ec1357ef953ddab07698c45c4992c1f4b1bd18e0000fa
|
|
BLAKE2b-256 checksum How to use checksums |
8e1f6d16c97ca0500ef3c994e54fc9883d2363e41b8a7159deeffc79647d3242
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|