Epics PV Server Protocol
EpicsPvServer is the EPICS V4 server-side bridge for exposing PyRogue tree
variables as PVs.
What It Does
EpicsPvServer publishes and serves EPICS-facing process variables using
the PyRogue integration layer.
Server Behavior
EpicsPvServer:
Requires a running
Rootbefore startup.Builds PV mappings either automatically (
base:path) or frompvMap.Supports include and exclude group filtering (default excludes
NoServe).Creates one
EpicsPvHolderper served variable and exposeslist()anddump()helpers for mapping inspection.
Constructor and Mapping Overview
EpicsPvServer(base=..., root=..., incGroups=..., excGroups=..., pvMap=...)
uses two mapping modes:
Automatic mode (
pvMap=None): serves variables that pass group filters using<base>:<path.with.colons>naming.Explicit mode (
pvMapdict): serves only mapped variable paths with user-defined PV names.
Default exclusion is ['NoServe'] when excGroups is not provided.
Setup Example
import pyrogue as pr
import pyrogue.protocols.epicsV4 as pep
class MyRoot(pr.Root):
def __init__(self):
super().__init__(name='MyRoot')
# Add variables/devices here as usual.
# Build EPICS server with automatic path-based naming.
self.epics = pep.EpicsPvServer(
base='MyIoc',
root=self,
incGroups=None,
excGroups=['NoServe'],
pvMap=None,
)
# Register as protocol so Root lifecycle starts/stops it.
self.addProtocol(self.epics)
with MyRoot() as root:
# Inspect active mapping.
root.epics.dump()
# Optionally write mapping to file for IOC/client integration.
root.epics.dump('epics_map.txt')
Typical Usage Pattern
The common setup follows this pattern:
Create and start a
Rootwith Local and Remote variables.Construct
EpicsPvServer(base=..., root=..., pvMap=...).Register it with
root.addProtocol(...).Use a P4P client to put and get values and confirm round-trip behavior.
When To Use It
You need external EPICS clients to consume or control values exposed by Rogue.
Your deployment requires EPICS compatibility alongside existing PyRogue tooling.
You want an explicit server boundary for EPICS protocol behavior.
Integration Guidance
Keep naming and unit conventions aligned between tree variables and EPICS PVs.
Document which PVs are authoritative control points versus status mirrors.
Pair this page with tree-side validation and polling strategy docs when the deployment depends on them.
Logging
EpicsPvServer uses Python logging.
Logger name:
pyrogue.EpicsPvServerConfiguration API:
logging.getLogger('pyrogue.EpicsPvServer').setLevel(logging.DEBUG)
This logger is used for PV mapping errors and other server-side operational messages emitted by the Python implementation.
What To Explore Next
Per-variable EPICS publication behavior: Epics PV Holder Protocol
API Reference
See EpicsPvServer for generated API details.