EpicsCA Python documentation


Overview

This module provides an interface to Epics Channel Access.
The main interface to Epics in this module is the pv object, which holds an Epics Process Variable (aka a 'channel').
Here's a simple example of using a pv:
>>> from EpicsCA import pv # import the pv class
>>> pv = pv('XXX:m1.VAL') # connect to a pv with its name.
>>> print pv.value # get the current value of the pv.
>>> pv.value = 3.0 # set the pv's value.
>>> print pv.get() # gets the current value.
>>> pv.put(3.0) # set the pv's value.
beyond getting and setting a pv's value, a pv includes these features:
  1. string representation of pv values.
  2. methods for information about the pv and its channel access connection, such as host name, units, precision, control and display limits, names of enumeration states, etc.
  3. support for user-defined "callbacks": python functions that are called automatically when the process variable changes.
  4. the put() method can optionally wait for processing to complete (for a motor to finish moving, for example).
See the documentation for the PV class below for a more complete description.

This module also contains simple caget(), caput(), and cainfo() functions for procedural use of Epics:
>>> from EpicsCA import caget, caput, cainfo
>>> print caget('XX.VAL')
>>> print caget('XX.VAL',use_char=True) # get 'friendly string representation'
>>> caput('XX.VAL', 3.1)
>>> print cainfo('XX.VAL') # print PV information
caget('XXX.VAL', use_char=True) will print out a well-formatted string for PVs that are DOUBLE or FLOAT type, or the Enumeration String for PVs of ENUM.

cainfo('XXX.VAL') will print out a message like this:

>>> EpicsCA.cainfo('XXX.VAL')
== XX.VAL
   value        = 2.1
   char_value   = 2.100
   count        = 1
   type         = double
   precision    = 3
   host         = iocxxx.aps.anl.gov:5064
   access       = read/write
   status       = 1
   severity     = 0
  no user callbacks defined.
==

Auto-generated documentation for EpicsCA classes: