Skip to main content

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


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.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

p2plantaccess-1.0.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file p2plantaccess-1.0.1.tar.gz.

File metadata

  • Download URL: p2plantaccess-1.0.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for p2plantaccess-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6ef04c8eaab4469959d4704866d56ac9549896cd65c03ccfe5a0acbdb4757c93
MD5 7746e83f3affdcaf08d04e24cf2958f2
BLAKE2b-256 4c716601fe74e60d4c48413ab12febb9d7d49908772e266cb3544e94a7a6f63f

See more details on using hashes here.

File details

Details for the file p2plantaccess-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: p2plantaccess-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for p2plantaccess-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68607098557dc18b273f64f8029f4ed7e9f6639b079a307d3df6f777bc14dd74
MD5 83993331c4894049bf08532715bfe4ae
BLAKE2b-256 42eb8ca5905890a9c4087709f15b41e5007d51bbec81a0c89691b382fca3e01f

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