Access to process variable of a P2Plant
Project description
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)}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
p2plantaccess-1.0.4.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file p2plantaccess-1.0.4.tar.gz.
File metadata
- Download URL: p2plantaccess-1.0.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02170f1fcaca6e5b6802b5e34d51857b1ff392aeabf5fdb0ddea1eb2d96c989
|
|
| MD5 |
008a1b6622e5994bd5243b9fb89b0120
|
|
| BLAKE2b-256 |
c125ee7807430bccdde497e0840524bd9856b34caad03ce79b31955c908f0735
|
File details
Details for the file p2plantaccess-1.0.4-py3-none-any.whl.
File metadata
- Download URL: p2plantaccess-1.0.4-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d41eacc4842076148ec1357ef953ddab07698c45c4992c1f4b1bd18e0000fa
|
|
| MD5 |
fe4905f4f2911b4e85e1c6145fdc399c
|
|
| BLAKE2b-256 |
8e1f6d16c97ca0500ef3c994e54fc9883d2363e41b8a7159deeffc79647d3242
|