pythonIoc¶
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 updated them and respond to caputs. It supports cothread and asyncio for concurrency.
PyPI |
|
Source code |
|
Documentation |
A simple example of the use of this library is the following:
# 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())
How the documentation is structured¶
Documentation is split into four categories, accessible from links below or in the side-bar. Use the links below or in the side-bar.
Tutorials¶
Tutorials for installation, library and commandline usage. New users start here.
How-to Guides¶
Practical step-by-step guides for the more experienced user.
Explanations¶
Explanation of how the library works and why it works that way.
Reference¶
Technical reference material, for classes, methods, APIs, commands, and contributing to the project.