53
Comment:
|
2610
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
* [[#Installation|Installation]] * [[#EpicsCA|EpicsCA]] * [[#EPICS IOC|EPICS IOC]] <<Anchor(Installation)>> == Installation == We assume that EPICS base is installed in /cvs/cds/kami/lib/epics/base. <<Anchor(EpicsCA)>> === EpicsCA === Download EpicsCA version 2 (not 3 yet) from below: http://cars9.uchicago.edu/~newville/Epics/Python/ Extract it in {{{/cvs/cds/kami/lib/epics/}}}. Set appropriate environmental variables (these are actually set by .cshrc, so you shouldn't have to be bothered). {{{ LD_LIBRARY_PATH=/cvs/cds/kami/lib/epics/base/lib/linux-x86_64 EPICS_BASE=/cvs/cds/kami/lib/epics/base EPICS_EXTENSIONS=/cvs/cds/kami/lib/epics/extensions EPICS_HOST_ARCH=linux-x86_64 }}} Run {{{ python setup.py build }}} You may need to install development files for python, if these are not installed yet. Run {{{ python setup.py install }}} as root. Be sure to source /home/controls/.cshrc to set the environmental variables. <<Anchor(EPICS IOC)>> == EPICS IOC == We want to have a dedicated IOC for the PicoMotor controller. Actually, this section gives you a general procedure to make a generic IOC. Make a directory in {{{/cvs/cds/kami/target}}}. In this example, we create {{{/cvs/cds/kami/target/k1pico}}}.<<BR>> Run the following commands in the created directory: {{{ /cvs/cds/kami/lib/epics/base/bin/linux-x86_64/makeBaseApp.pl -t example k1pico /cvs/cds/kami/lib/epics/base/bin/linux-x86_64/makeBaseApp.pl -i -t example k1pico }}} {{{example}}} is the name of a template. {{{example}}} is a good template to start. {{{k1pico}}} is the name of your IOC. Usually, we want to start it with {{{k1}}}. Type {{{make}}} in the directory. The EPICS build system will compile an IOC. Modify {{{db/*.db}}} file. Then go to {{{iocBoot/iock1pico}}} and run {{{st.cmd}}}. Now, for the PicoMotor controller, we have to put {{{pmepics.db}}} in the {{{db/}}} directory. This file is automatically generated by {{{pmGenDbMedm.py}}} script. Then you have to add a line like the following to {{{iocBoot/iock1pico/st.cmd}}}. {{{ dbLoadRecords("db/pmepics.db", "site=K1") }}} Run the IOC by typing {{{ cd /cvs/cds/kami/target/k1pico/iocBoot/iock1pico ./st.cmd }}} == Generating db file and MEDM screens == {{{pmGenDbMedm.py}}} is a python script to automatically generate an EPICS db file, MEDM screens and an autoBurt request file. The usage is: {{{ pmGenDbMedm.py -c pmepics.conf }}} The syntax of {{{pmepics.conf}}} is explained at the beginning of the file as comments. |
PicoMotor control system using EPICS and Python
Installation
We assume that EPICS base is installed in /cvs/cds/kami/lib/epics/base.
EpicsCA
Download EpicsCA version 2 (not 3 yet) from below:
http://cars9.uchicago.edu/~newville/Epics/Python/
Extract it in /cvs/cds/kami/lib/epics/.
Set appropriate environmental variables (these are actually set by .cshrc, so you shouldn't have to be bothered).
LD_LIBRARY_PATH=/cvs/cds/kami/lib/epics/base/lib/linux-x86_64 EPICS_BASE=/cvs/cds/kami/lib/epics/base EPICS_EXTENSIONS=/cvs/cds/kami/lib/epics/extensions EPICS_HOST_ARCH=linux-x86_64
Run
python setup.py build
You may need to install development files for python, if these are not installed yet.
Run
python setup.py install
as root. Be sure to source /home/controls/.cshrc to set the environmental variables.
EPICS IOC
We want to have a dedicated IOC for the PicoMotor controller. Actually, this section gives you a general procedure to make a generic IOC.
Make a directory in /cvs/cds/kami/target. In this example, we create /cvs/cds/kami/target/k1pico.
Run the following commands in the created directory:
/cvs/cds/kami/lib/epics/base/bin/linux-x86_64/makeBaseApp.pl -t example k1pico /cvs/cds/kami/lib/epics/base/bin/linux-x86_64/makeBaseApp.pl -i -t example k1pico
example is the name of a template. example is a good template to start. k1pico is the name of your IOC. Usually, we want to start it with k1.
Type make in the directory. The EPICS build system will compile an IOC.
Modify db/*.db file. Then go to iocBoot/iock1pico and run st.cmd.
Now, for the PicoMotor controller, we have to put pmepics.db in the db/ directory. This file is automatically generated by pmGenDbMedm.py script. Then you have to add a line like the following to iocBoot/iock1pico/st.cmd.
dbLoadRecords("db/pmepics.db", "site=K1")
Run the IOC by typing
cd /cvs/cds/kami/target/k1pico/iocBoot/iock1pico ./st.cmd
Generating db file and MEDM screens
pmGenDbMedm.py is a python script to automatically generate an EPICS db file, MEDM screens and an autoBurt request file.
The usage is:
pmGenDbMedm.py -c pmepics.conf
The syntax of pmepics.conf is explained at the beginning of the file as comments.