pythonSoftIoc follow these steps:
Edit the following files:
EPICS_BASEto point to your local installation of EPICS.
PYTHONto the executable name of your Python interpreter.
pythonIocwithout documentation by running:
At this point you should be able to run
./pythonIocwhich will give you an interative Python interpreter.
Now ensure that you have numpy, cothread, and epicsdbbuilder installed. These can be installed unversioned, or versioned (in which case
pkg_resources.requirewill need to be used), or just localling built and added to your
Now check that
pythonIocworks by running
example/runtest. You may need to edit
example/version.pyif you're using a versioned install of
Finally build the documentation by running:
Again, if your installation of components is versioned you may need to edit
Probably the best way to use
pythonSoftIoc is to start by copying fragments
of a simple example such as
CS-DI-IOC-02. This consists of the following
A startup shell script
start-iocwhich launches the soft IOC using a production build of
pythonSoftIoc. This script typically looks like this:
#!/bin/sh PYIOC=/path/to/pythonSoftIoc/pythonIoc cd "$(dirname "$0")" exec $PYIOC start_ioc.py "$@"
The startup Python script. This establishes the essential component versions (apart from the
pythonSoftIocversion), performs the appropriate initialisation and starts the IOC running. The following template is a useful starting point:
from pkg_resources import require require('cothread==2.12') require('epicsdbbuilder==1.0') # Import the basic framework components. from softioc import softioc, builder import cothread # Import any modules required to run the IOC import ... # Boilerplate get the IOC started builder.LoadDatabase() softioc.iocInit() # Start processes required to be run after iocInit ... # Finally leave the IOC running with an interactive shell. softioc.interactive_ioc(globals())
Note that the use of
requireis specific to DLS, and you may have a different way of managing your installations.