Caproto is an implementation of the
EPICS Channel Access protocol for
distributed hardware control in pure Python with a “sans-I/O”
architecture.
Caproto is a toolkit for building Python programs that speak Channel
Access (“EPICS”). It includes a reusable core that encodes the Channel
Access protocol. It also includes several client and server
implementations built on that core. This layered design is inspired by
the broad effort in the Python community to write sans-I/O
implementations of network protocols.
The EPICS (Experimental Physics and Industrial Control System) Channel
Access protocol is used in laboratories and companies around the
world to
implement distributed control systems for devices such as large
telescopes, particle accelerators, and synchrotrons. Its
roots
go back to a 1988 meeting funded by the Reagan-era Strategic Defense
Initiative (“Star Wars”).
The authors pronounce caproto “kah-proto” (not “C.A. proto”).
Caproto is intended as a friendly entry-point to EPICS. It may be useful
for scientists who want to understand their hardware better, engineers
learning more about the EPICS community, and “makers” interested in
using it for hobby projects — EPICS has been used for brewing beer and
keeping bees! At the same time, caproto is suitable for use at large
experimental facilities.
Features
A “sans-I/O” core of the EPICS Channel Access protocol.
Multiple client and
server
implementations built on on the sans-I/O core.
asyncio client and server
Curio and trio server
Threaded client (a caproto-specific API and a pyepics-compat layer)
Synchronous (non-threaded) client
A large tool suite for building pure Python IOCs.
Try caproto in four lines
First verify that you have Python 3.8+.
python3 --version
If necessary, install it by your method of choice (apt, Homebrew, conda,
etc.). Now install caproto:
python3 -m pip install -U caproto
In one terminal, start an EPICS Input-Output Controller (IOC), which is
a server.
python3 -m caproto.ioc_examples.simple --list-pvs
In another, use the command-line client:
caproto-put simple:A 42
This sets the value to 42. See the
documentation for more details on these
tools.
When to use caproto and when not to use caproto
caproto is good for:
Writing simulation and testing IOCs
Writing IOCs to interface with modern technology (could be minutes/hours vs
days/weeks, depending on the application)
Aiding debugging of connectivity and Channel Access issues
Learning about the Channel Access protocol and EPICS in general
Simple installation and usage (no build tools or knowledge thereof required)
caproto is not intended for the following, where epics-base excels:
Mission-critical or performance-critical applications
Who uses it
SLAC LCLS
BNL NSLS-II
IOC examples
Here are some examples of IOCs in the wild.
These are in no particular order. Feel free to add yours to this list in a Pull Request!
caproto
caproto: a bring-your-own-IO implementation of the EPICS Channel Access protocol in pure Python
Documentation
Overview
Caproto is an implementation of the EPICS Channel Access protocol for distributed hardware control in pure Python with a “sans-I/O” architecture.
Caproto is a toolkit for building Python programs that speak Channel Access (“EPICS”). It includes a reusable core that encodes the Channel Access protocol. It also includes several client and server implementations built on that core. This layered design is inspired by the broad effort in the Python community to write sans-I/O implementations of network protocols. The EPICS (Experimental Physics and Industrial Control System) Channel Access protocol is used in laboratories and companies around the world to implement distributed control systems for devices such as large telescopes, particle accelerators, and synchrotrons. Its roots go back to a 1988 meeting funded by the Reagan-era Strategic Defense Initiative (“Star Wars”).
The authors pronounce caproto “kah-proto” (not “C.A. proto”).
Caproto is intended as a friendly entry-point to EPICS. It may be useful for scientists who want to understand their hardware better, engineers learning more about the EPICS community, and “makers” interested in using it for hobby projects — EPICS has been used for brewing beer and keeping bees! At the same time, caproto is suitable for use at large experimental facilities.
Features
Try caproto in four lines
First verify that you have Python 3.8+.
If necessary, install it by your method of choice (apt, Homebrew, conda, etc.). Now install caproto:
In one terminal, start an EPICS Input-Output Controller (IOC), which is a server.
In another, use the command-line client:
This sets the value to 42. See the documentation for more details on these tools.
When to use caproto and when not to use caproto
caproto is good for:
caproto is not intended for the following, where epics-base excels:
Who uses it
IOC examples
Here are some examples of IOCs in the wild.
These are in no particular order. Feel free to add yours to this list in a Pull Request!
Client-related and miscellaneous examples
Here are some other caproto-adjacent things that may be of interest:
Others could be found through: https://github.com/caproto/caproto/network/dependents
Command-line tools
caproto offers a variety of command-line tools. Here are their names and epics-base equivalents:
caproto-getcagetcaproto-putcaputcaproto-monitorcamonitorcaproto-repeatercaRepeatercaproto-sharkwireshark + cashark