https://github.com/diamondlightsource/pythonsoftioc
Embed an EPICS IOC in a Python process
https://github.com/diamondlightsource/pythonsoftioc
from-dls-controls
Last synced: 3 months ago
JSON representation
Embed an EPICS IOC in a Python process
- Host: GitHub
- URL: https://github.com/diamondlightsource/pythonsoftioc
- Owner: DiamondLightSource
- License: apache-2.0
- Created: 2014-05-22T05:48:22.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-07-08T14:05:04.000Z (6 months ago)
- Last Synced: 2025-07-08T14:38:55.178Z (6 months ago)
- Topics: from-dls-controls
- Language: Python
- Homepage:
- Size: 29.1 MB
- Stars: 37
- Watchers: 23
- Forks: 8
- Open Issues: 19
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
pythonSoftIOC
=============
|code_ci| |docs_ci| |coverage| |pypi_version| |license|
This module allows an EPICS IOC with Python Device Support to be run from within
the Python interpreter. Records can be programmatically created and arbitrary
Python code run to update them and respond to caputs. It supports cothread and
asyncio for concurrency. PVs are served over Channel Access and PVAccess.
============== ==============================================================
PyPI ``pip install softioc``
Source code https://github.com/DiamondLightSource/pythonSoftIOC
Documentation https://DiamondLightSource.github.io/pythonSoftIOC
Changelog https://github.com/DiamondLightSource/pythonSoftIOC/blob/master/CHANGELOG.rst
============== ==============================================================
A simple example of the use of this library:
.. code:: python
# Import the basic framework components.
from softioc import softioc, builder
import cothread
# Set the record prefix
builder.SetDeviceName("MY-DEVICE-PREFIX")
# Create some records
ai = builder.aIn('AI', initial_value=5)
ao = builder.aOut('AO', initial_value=12.45, on_update=lambda v: ai.set(v))
# Boilerplate get the IOC started
builder.LoadDatabase()
softioc.iocInit()
# Start processes required to be run after iocInit
def update():
while True:
ai.set(ai.get() + 1)
cothread.Sleep(1)
cothread.Spawn(update)
# Finally leave the IOC running with an interactive shell.
softioc.interactive_ioc(globals())
.. |code_ci| image:: https://github.com/DiamondLightSource/pythonSoftIOC/workflows/Code%20CI/badge.svg?branch=master
:target: https://github.com/DiamondLightSource/pythonSoftIOC/actions?query=workflow%3A%22Code+CI%22
:alt: Code CI
.. |docs_ci| image:: https://github.com/DiamondLightSource/pythonSoftIOC/workflows/Docs%20CI/badge.svg?branch=master
:target: https://github.com/DiamondLightSource/pythonSoftIOC/actions?query=workflow%3A%22Docs+CI%22
:alt: Docs CI
.. |coverage| image:: https://codecov.io/gh/DiamondLightSource/pythonSoftIOC/branch/master/graph/badge.svg
:target: https://codecov.io/gh/DiamondLightSource/pythonSoftIOC
:alt: Test Coverage
.. |pypi_version| image:: https://img.shields.io/pypi/v/softioc.svg
:target: https://pypi.org/project/softioc
:alt: Latest PyPI version
.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
:target: https://opensource.org/licenses/Apache-2.0
:alt: Apache License
..
Anything below this line is used when viewing README.rst and will be replaced
when included in index.rst
See https://DiamondLightSource.github.io/pythonSoftIOC for more detailed documentation.