From a machine on the SLAC network (like centos7.slac.stanford.edu), ssh into pc101221 using your unix username and password.


Activate whatever the conda environment you need to do your work.


Then source this setup script to set the environment variables needed to get read only access to live EPICS PVs, as well as write access to a much smaller subset. It will also place a custom built version of p4p (python package for pvAccess requests) onto your PYTHONPATH for using a tls-enabled EPICS client.


$ source /home/jesseb/setup/set-env.sh


In order to write PVs using secure EPICS, the p4p python package mentioned above should be used. This will be automatically available to you from the script sourced above, no need to install it into your environment. It is currently build for python 3.9 and 3.12, but easy enough to add other versions in the future if needed. The small python snippet below shows an example of how to use p4p to both read and write to PVs. Note that from the GPU box write access is only allowed to a small subset of PVs.


$ python
Python 3.9.19 | packaged by conda-forge | (main, Mar 20 2024, 12:50:21) 
[GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from p4p.client.thread import Context
>>> ctxt = Context('pva')
>>> ctxt.put('LUME:OTRS:IN20:571:XRMS', 2345)
>>> ctxt.get('LUME:OTRS:IN20:571:XRMS')
2345.0
>>> 

  • No labels