学习记录
条件:已安装epics,synApps,extensions_medm
系统:centos7
在synApps的areaDetector模块中有一个仿真探测器,几乎探测器所有的参数它都可以模拟,除了文件存储。
官网介绍:This is an EPICS areaDetector driver for a simulated area detector.The simulation detector is useful as a model for writing real detector drivers. It is also very useful for testing plugins and channel access clients.ADSimDetector — areaDetector 3-11-2-gf866e7e documentation
1. 查看编译方法
vi /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/iocs/simDetectorIOC/iocBoot/iocSimDetector/readme
2. 修改Makefile
vi /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/iocs/simDetectorIOC/iocBoot/iocSimDetector/Makefile
注释掉其他ARCH, 选择自己的系统
3. 在SimDetector下进行编译
make clean && make
cp envPaths envPaths.linux
3.查看iocSimDetector内文件
进入文件夹,以下几个文件不同系统对应不同后缀(.vxWorks .windows .linux .mingw),根据自己系统修改相应文件
cd /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/iocs/simDetectorIOC/iocBoot/iocSimDetector
a. 查看envPATHs.linux ,用于设置环境变量
b. 查看st_base.cmd ,用于设置探测器基本参数、pv name、通讯地址,加载db文件,dbd文件,环境变量等。
c. 查看st.cmd.linux文件,用于加载上两个文件
d. 查看start_epics文件,用于启动medm界面和st.cmd.linux ,确保“P= ,R= ”中的内容 与st_base.cmd设置相同
4. 添加 *.adl文件,配置环境变量
cd /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/iocs/simDetectorIOC/simDectorApp
cp -r /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/simDetectorApp/op/adl adl
cd ~
vi .bashrc
source .bashrc
修改的内容
5. 修改文件名,不然运行时会报错
cd /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADCore/iocBoot
mv examplecommonPligins.cmd commonPligins.cmd
mv examplecommonPlugin_settings.req commonPlugin_settings.req
6.配置epics的channel access address list ,5064为端口
cd ~
vi .bashrc
source .bashrc
#多IP:端口 需加引号,空格隔开 epics channel access address lists="ip:5064 ip:5064 ip:5064"
export EPICS_CA_ADDR_LIST=localhost:5064
export EPICS_CA_AUTO_ADDR_LIST=NO
7.启动simDetector
cd /home/zsy/epics/synApps/support/areaDetector-R3-3-1/ADSimDetector/iocs/simDetectorIOC/iocBoot/iocSimDetector/
./start_epics
8. *.adl不全,打开medm报错
medm提示缺 *.adl文件,去<support>或者 <support>/areaDetector-R3-3-1/ADCore/ADApp/op/adl 里copy到自己的adl文件夹里。
9.重新启动
10. ok 试试 以下命令 ,要加pv name
caput
caget
cainfo