杭州网站建设公司排行,广告设计与制作流程,网站建设模板套用,快速做彩平图得网站本实例使用motor模块中软电机#xff0c;通过通道访问控制另一个直流电源IOC的输出电压#xff0c;并且回读输出电压。 此处使用的另一个IOC为#xff1a;基于EPICS stream模块的直流电源的IOC控制程序实例-CSDN博客
1#xff09;创建这个IOC程序目录结构#xff0c;操作…本实例使用motor模块中软电机通过通道访问控制另一个直流电源IOC的输出电压并且回读输出电压。 此处使用的另一个IOC为基于EPICS stream模块的直流电源的IOC控制程序实例-CSDN博客
1创建这个IOC程序目录结构操作演示如下
rootbl02u2-X1:/usr/local/EPICS/program# mkdir softmotor
rootbl02u2-X1:/usr/local/EPICS/program# cd softmotor/
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# ls
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# source /etc/profile.d/epics.sh
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# ls
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# makeBaseApp.pl -t ioc softmotor
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# makeBaseApp.pl -i -t ioc softmotor
Using target architecture linux-x86_64 (only one available)
The following applications are available:softmotor
What application should the IOC(s) boot?
The default uses the IOCs name, even if not listed above.
Application name?
rootbl02u2-X1:/usr/local/EPICS/program/softmotor#
rootbl02u2-X1:/usr/local/EPICS/program/softmotor# ls
configure iocBoot Makefile softmotorApp2编辑configure/RELEASE文件列出本IOC中使用到的模块所在的路径
...
SUPPORT/usr/local/EPICS/synApps/support# If any motor controller communication mechanism besides
# the VME backplane is required, then ASYN must be defined.
# Recommended ASYN release: R4-35
ASYN$(SUPPORT)/asyn
MOTOR$(SUPPORT)/motor# EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE /usr/local/EPICS/base...
3) 进入softmotorApp/src/目录编辑Makefile文件添加这个IOC将使用到的数据库定义文件和库文件
PROD_IOC softmotor
# softmotor.dbd will be created and installed
DBD softmotor.dbd# softmotor.dbd will be made up from these files:
softmotor_DBD base.dbd
softmotor_DBD asyn.dbd
softmotor_DBD motorSupport.dbd
softmotor_DBD devSoftMotor.dbd# Include dbd files from all support applications:
#softmotor_DBD xxx.dbd# Add all the support libraries needed by this IOC
softmotor_LIBS asyn
softmotor_LIBS motor
softmotor_LIBS softMotor# softmotor_registerRecordDeviceDriver.cpp derives from softmotor.dbd
softmotor_SRCS softmotor_registerRecordDeviceDriver.cpp# Build the main IOC entry point on workstation OSs.
softmotor_SRCS_DEFAULT softmotorMain.cpp
softmotor_SRCS_vxWorks -nil-# Add support from base/src/vxWorks if needed
#softmotor_OBJS_vxWorks $(EPICS_BASE_BIN)/vxComLibrary# Finally link to the EPICS Base libraries
softmotor_LIBS $(EPICS_BASE_IOC_LIBS)#include $(TOP)/configure/RULES
4进入softmotorApp/Db目录添加数据库实例文件以及Makefile文件
# softMotor.db
record(motor, $(P)$(M)SoftMotor) {field(DESC, Set Voltage)field(SCAN, Passive)field(DTYP, Soft Channel)field(VELO, 0.1)field(VBAS, 0.1)field(OUT, $(USER)SetVoltage) # Set Voltage for another IOC of a devicefield(RINP, $(P)$(M)convertReadbackValue) # Readback Voltagefield(UEIP, No)field(URIP, No)field(PREC, 2)field(EGU, V)field(DHLM, 40)field(DLLM, 0)field(RTRY, 0)field(TWV, 0.01)field(NTM, NO)field(MRES, 0.01)field(RRES, 0.01)field(VELO, 0.01)field(VBAS, 0.01)field(IGSET, 1)}grecord(calcout,$(P)$(M)convertReadbackValue)
{field(DESC,ReadBack Voltage to feed the SoftMotor Record)field(CALC,A * 100)field(INPA,$(USER)Voltage_RBV CP MS)
}
将这个db文件添加到相同路径中的Makefile中
...
DB softMotor.db
...
5) 回到这个IOC的顶层目录执行make命令编译这个IOC程序。
6进入iocBoot/iocsoftmotor目录编辑st.cmd启动脚本
...
dbLoadRecords(db/softMotor.db,PSoftMotor:,MM1:,USERUDP6721:)
...
7 启动以上IOC
rootbl02u2-X1:/usr/local/EPICS/program/softmotor/iocBoot/iocsoftmotor# ../../bin/linux-x86_64/softmotor st.cmd
#!../../bin/linux-x86_64/softmotorenvPaths
...
epics dbl
SoftMotor:M1:convertReadbackValue
SoftMotor:M1:SoftMotor
epics8) 调出以上两个IOC的图形控制界面每按一次电机界面中TWF按钮输出电压增加0.01V。
通过以上转换能够用电机控制方式来控制一个直流电压源输出电压如在sscan模块中进行电压扫描 在SPEC软件中可以配置一路EPICS电机来设置输出电压
210.SPEC dscan sm -1 1 20 1
Total 21 points, 21 secondsScan 15 Fri Dec 01 02:08:26 2023 file test spec user blctrl
ascan sm 1 3 20 1# SoftMotor Seconds Seconds Seconds Monitor Detector Counter0 1.0000 1 1 1 0 0 01 1.1000 1 1 1 0 0 02 1.2000 1 1 1 0 0 03 1.3000 1 1 1 0 0 04 1.4000 1 1 1 0 0 05 1.5000 1 1 1 0 0 06 1.6000 1 1 1 0 0 07 1.7000 1 1 1 0 0 08 1.8000 1 1 1 0 0 09 1.9000 1 1 1 0 0 010 2.0000 1 1 1 0 0 011 2.1000 1 1 1 0 0 012 2.2000 1 1 1 0 0 013 2.2900 1 1 1 0 0 014 2.4000 1 1 1 0 0 015 2.5000 1 1 1 0 0 016 2.6000 1 1 1 0 0 017 2.7000 1 1 1 0 0 018 2.8000 1 1 1 0 0 019 2.9000 1 1 1 0 0 020 3.0000 1 1 1 0 0 0Returning sm to 2