Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Spvirit

Spvirit is a pure-Rust implementation of the EPICS PVAccess protocol — client, server, wire codec, command-line tools, and Python bindings — with no dependency on an EPICS base installation.

Quickstart

Install. This one command brings the Python module and the twelve sp* command-line tools; there is no compiler and no Rust toolchain involved on Linux, macOS, or Windows x86_64.

pip install spvirit

Save this as first.py — it is a complete soft IOC serving three PVs:

temp = spvirit.ai("SIM:TEMPERATURE", 22.5)      # input  — read-only to clients
setpoint = spvirit.ao("SIM:SETPOINT", 25.0)     # output — clients may write
enable = spvirit.bo("SIM:ENABLE", False)        # output — a writable bool

server = spvirit.Server(pvs=[temp, setpoint, enable])
server.run()

Run it, and read a PV from a second terminal:

python first.py            # terminal 1 — it blocks, serving
$ spget SIM:TEMPERATURE
SIM:TEMPERATURE 2026-08-06 09:38:00.729 22.5

$ spput SIM:SETPOINT 30
SIM:SETPOINT OK

$ spget SIM:SETPOINT
SIM:SETPOINT 2026-08-06 09:38:00.729  30

If you see those three lines you have a working PVAccess server. Nobody configured a port, an address, or a permission: the client broadcast the PV name, the server answered, and SIM:TEMPERATURE refused the write it should refuse because ai is an input record.

The same thing in Rust is Your first PV; every chapter of this book shows both languages.

Where to go next

How the site is laid out

API reference

This book is the tutorial. The exhaustive, generated API documentation lives on docs.rs, one page per crate:

CrateAPI docs
spvirit-typesdocs.rs/spvirit-types
spvirit-codecdocs.rs/spvirit-codec
spvirit-clientdocs.rs/spvirit-client
spvirit-serverdocs.rs/spvirit-server
spvirit-toolsdocs.rs/spvirit-tools
spvirit-calcdocs.rs/spvirit-calc

For Python there is no generated site; the Python API chapter is the reference, and every object carries a docstring, so help(spvirit.ai) works at the prompt.

Project

Every code sample on this site is included verbatim from a file in the repository that is compiled by CI. The badge at the top of each chapter links to that source and to the test that checks it — including the quickstart above:

Verified · demo_first_pv.py · check docs_verify · docs-verify

The badge reports the whole docs-verify suite, not this chapter alone.