Skip to main content

Library for process data exchange

Project description

pipeline status coverage report online c++ documentation online python documentation

This is the README file of the PdCom library, that is part of the EtherLab project (http://etherlab.org/en). The home of PdCom is http://etherlab.org/en/pdcom. The Library is released under the terms and conditions of the GNU Lesser General Public License (LGPL), version 3 or (at your option) any later version.

Documentation

You can find the documentation online here (C++) and here (Python).

The library documentation resides in the header files and can be brought to HTML, LaTeX and man format with the doxygen tool. To generate the documentation, make sure that doxygen is installed and then call:

    git submodule update --init
    mkdir build
    cd build
    cmake ..
    make doc

Then point your favourite browser to doc/html/index.html.

Building and Installing

To just build and install the library, call:

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make
    make install

You'll need the following packages:

  • libexpat-devel
  • libgnutls-devel
  • cyrus-sasl-devel

For running the unit tests, the GTest library is required.

Python API

In the python subdirectory, an asyncio based Python API is provided. It requires Python >= 3.6, numpy and pybind11 >= 2.6.0. Please note that make install does not install this Python module. Instead, please navigate to the python subdirectory after installing the C++ library and install the pdcom5 python module using pip3 install ..

There are also some pre-built wheel packages available. Use pip3 install pdcom5 to install pdcom5 from PyPI.

The starting point for almost everything is the Process class which is in charge of handling the communication. You can use it to find variables, to set parameters and to subscribe to signals. Most of the functions in this API are coroutines, which have to be awaited.

In this snippet, a connection is made to the oscillator example in PdServ. Its cosine output is subscribed to with a period of one second. The value is printed five times, then the enable Parameter is set to False. After that, the cosine output is polled twice. Note that for the interactive asyncio REPL (python3 -m asyncio), Python >= 3.8 is required.

>>> import pdcom5
>>> process = pdcom5.Process()
>>> await process.connect("msr://localhost:2345")
>>> variable = await process.find("/osc/cos")
>>> variable.shape
(1,)
>>> sub = await process.subscribe(1.0, variable)
>>> for i in range(5):
...     await sub.read()
...
(8.78446130364271, datetime.timedelta(days=19459, seconds=29086, microseconds=437320))
(7.851994244479773, datetime.timedelta(days=19459, seconds=29087, microseconds=437407))
(-3.094420865989016, datetime.timedelta(days=19459, seconds=29088, microseconds=437398))
(-10.094402900214018, datetime.timedelta(days=19459, seconds=29089, microseconds=437408))
(-4.220607508690086, datetime.timedelta(days=19459, seconds=29090, microseconds=437397))
>>> await process.setVariableValue("/osc/enable", False)
>>> await variable.poll()
(-2.7455815235765124, datetime.timedelta(days=19459, seconds=29159, microseconds=877336))
>>> await variable.poll()
(-2.7455815235765124, datetime.timedelta(days=19459, seconds=29160, microseconds=817388))

There is also Transmission.event_mode and Transmission.poll_mode for creating non-periodical subscriptions

Further Information

For questions of any kind, subscribe to the etherlab-users mailing list at http://etherlab.org/en.

Have fun with PdCom!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pdcom5-5.2.5-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-pp37-pypy37_pp73-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp312-cp312-win_amd64.whl (282.7 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pdcom5-5.2.5-cp312-cp312-win32.whl (240.7 kB view hashes)

Uploaded CPython 3.12 Windows x86

pdcom5-5.2.5-cp312-cp312-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp312-cp312-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp311-cp311-win_amd64.whl (282.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pdcom5-5.2.5-cp311-cp311-win32.whl (242.5 kB view hashes)

Uploaded CPython 3.11 Windows x86

pdcom5-5.2.5-cp311-cp311-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp311-cp311-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp310-cp310-win_amd64.whl (282.3 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pdcom5-5.2.5-cp310-cp310-win32.whl (242.0 kB view hashes)

Uploaded CPython 3.10 Windows x86

pdcom5-5.2.5-cp310-cp310-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp310-cp310-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp39-cp39-win_amd64.whl (277.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pdcom5-5.2.5-cp39-cp39-win32.whl (242.1 kB view hashes)

Uploaded CPython 3.9 Windows x86

pdcom5-5.2.5-cp39-cp39-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp39-cp39-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp38-cp38-win_amd64.whl (282.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pdcom5-5.2.5-cp38-cp38-win32.whl (241.7 kB view hashes)

Uploaded CPython 3.8 Windows x86

pdcom5-5.2.5-cp38-cp38-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp38-cp38-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp37-cp37m-manylinux_2_28_armv7l.whl (2.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.28+ ARMv7l

pdcom5-5.2.5-cp37-cp37m-manylinux_2_28_aarch64.whl (2.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.28+ ARM64

pdcom5-5.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (487.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pdcom5-5.2.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (486.0 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page