diff --git a/configure/RELEASE b/configure/RELEASE index dd63a21..41fe199 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -34,7 +34,8 @@ MOTOR=/opt/epics/modules/motor/6.10.0/3.14.12.5 ASYN=/opt/epics/modules/asyn/4.27.0/3.14.12.5 SYNAPPSSTD=/opt/epics/modules/synAppsStd/3.4.1/3.14.12.5/ #ANC=/usr/local/epics/anc350v17 -#STREAMS=/opt/epics/modules/streamdevice/2.6.0/3.14.12.5 +STREAMS=/opt/epics/modules/streamdevice/2.6.0/3.14.12.5 #LAKESHORE336=/usr/local/epics/support/lakeshore336 BUSY=/opt/epics/modules/busy/1.6.0/3.14.12.5 #OXINSTCRYOJET=/usr/local/epics/support/OxInstCryojet-2-18-3 +PCRE=/opt/epics/modules/pcre/8.36.0/3.14.12.5 diff --git a/iocBoot/iocsinqEPICS/envPaths b/iocBoot/iocsinqEPICS/envPaths index 78b6878..f2d6760 100644 --- a/iocBoot/iocsinqEPICS/envPaths +++ b/iocBoot/iocsinqEPICS/envPaths @@ -1,10 +1,10 @@ epicsEnvSet("ARCH","centos7-x86_64") epicsEnvSet("IOC","sinqEPICS") -epicsEnvSet("TOP","/opt/amor/epics") +epicsEnvSet("TOP","/afs/psi.ch/project/sinqdev/sinqepicsapp") epicsEnvSet("EPICS_BASE","/opt/epics/bases/base-3.14.12.5") epicsEnvSet("ASYN","/opt/epics/modules/asyn/4.27.0") epicsEnvSet("MOTOR","/opt/amor/epics") epicsEnvSet("SYNAPPSSTD","/opt/epics/modules/synAppsStd/3.4.1") #epicsEnvSet("LAKESHORE336","/usr/local/epics/support/lakeshore336") - +epicsEnvSet("STREAM","/opt/epics/modules/streamdevice/2.7.1") diff --git a/iocBoot/iocsinqEPICS/stslsvme.cmd b/iocBoot/iocsinqEPICS/stslsvme.cmd new file mode 100755 index 0000000..c8f22b6 --- /dev/null +++ b/iocBoot/iocsinqEPICS/stslsvme.cmd @@ -0,0 +1,34 @@ +#!../../bin/centos7-x86_64/sinqEPICS +# for debugging.................. +## You may have to change sinqEPICS to something else +## everywhere it appears in this file + +< envPaths + +cd ${TOP} + +## Register all support components +dbLoadDatabase "dbd/sinqEPICS.dbd" +dbLoadDatabase "dbd/sinq.dbd" +sinqEPICS_registerRecordDeviceDriver pdbbase + +## Load record instances +#dbLoadRecords("db/xxx.db","user=koenneckeHost") + + +#---------- Install SLSVME +drvAsynIPPortConfigure("slsvme", "mpc2084:60066",0,0,0) +#drvAsynIPPortConfigure("slsvme", "localhost:8080",0,0,0) + +dbLoadRecords("$(ASYN)/db/asynRecord.db","P=SQ:AMOR:,R=slsvme,PORT=slsvme,ADDR=0,OMAX=80,IMAX=80") + +epicsEnvSet ("STREAM_PROTOCOL_PATH", "$(TOP)/sinqEPICSApp/Db:.") + +cd ${TOP}/iocBoot/iocsinqEPICS +dbLoadRecords("slsvme.db","PREFIX=SQ:AMOR:PBY:,NO=1") + + +iocInit + +## Start any sequence programs +#seq sncxxx,"user=koenneckeHost" diff --git a/sinqEPICSApp/Db/Makefile b/sinqEPICSApp/Db/Makefile index 983981d..9ddbce8 100644 --- a/sinqEPICSApp/Db/Makefile +++ b/sinqEPICSApp/Db/Makefile @@ -10,7 +10,7 @@ include $(TOP)/configure/CONFIG #---------------------------------------------------- # Create and install (or just install) into /db # databases, templates, substitutions like this -#DB += xxx.db +DB_INSTALL += slsvme.proto #---------------------------------------------------- # If .db template is not named *.template add diff --git a/sinqEPICSApp/Db/slsvme.db b/sinqEPICSApp/Db/slsvme.db new file mode 100644 index 0000000..d6f079b --- /dev/null +++ b/sinqEPICSApp/Db/slsvme.db @@ -0,0 +1,94 @@ +# Database definition for the SLS VME magnets as installed at AMOR + +## +## Read the High Limit +## +record(ai, "$(PREFIX)HighLim") { + field(DTYP, "stream") + field(DESC, "High Current Limit") + field(INP, "@slsvme.proto read($(NO),hl) slsvme 0") + field(SCAN, "1 second") + field(PREC, "3") + field(EGU, "A") +} + +## +## Read the High Limit +## +record(ai, "$(PREFIX)LowLim") { + field(DTYP, "stream") + field(DESC, "Low Current Limit") + field(INP, "@slsvme.proto read($(NO),ll) slsvme 0") + field(SCAN, "1 second") + field(PREC, "3") + field(EGU, "A") +} + +## +## Read the Error code +## +record(ai, "$(PREFIX)ErrCode") { + field(DTYP, "stream") + field(DESC, "Error Code") + field(INP, "@slsvme.proto read($(NO),err) slsvme 0") + field(SCAN, "1 second") + field(PREC, "3") + field(EGU, "A") +} + +## +## Read the textual representation of the error. +## +record(stringin, "$(PREFIX)ErrText") { + field(DTYP, "stream") + field(INP, "@slsvme.proto readErrTxt($(NO)) slsvme 0") + field(SCAN, "1 second") + field(PINI, "YES") +} + + +## +## Read the Current +## +record(ai, "$(PREFIX)CurRBV") { + field(DTYP, "stream") + field(DESC, "Low Current Limit") + field(INP, "@slsvme.proto read($(NO),cur) slsvme 0") + field(SCAN, "1 second") + field(PREC, "3") + field(EGU, "A") +} + +## +## Set the current +## +record(ao, "$(PREFIX)CurSet") { + field(DTYP, "stream") + field(DESC, "Setpoint current") + field(OUT, "@slsvme.proto write($(NO),cur) slsvme 0") + field(PREC, "3") + field(EGU, "A") +} + +## +## Read power status of the magnet +## +record(bi, "$(PREFIX)PowerStatusRBV") { + field(DESC, "Readback of the power status") + field(DTYP, "stream") + field(INP, "@slsvme.proto readonoff($(NO)) slsvme 0") + field(SCAN, "1 second") + field(ZNAM, "off") + field(ONAM, "on") +} + +## +## Set the power status +## +record(bo, "$(PREFIX)PowerStatus") { + field(DESC, "Set the power status") + field(DTYP, "stream") + field(OUT, "@slsvme.proto setpower($(NO)) slsvme 0") + field(ZNAM, "on") + field(ONAM, "off") +} diff --git a/sinqEPICSApp/Db/slsvme.proto b/sinqEPICSApp/Db/slsvme.proto new file mode 100644 index 0000000..dfcbc2f --- /dev/null +++ b/sinqEPICSApp/Db/slsvme.proto @@ -0,0 +1,31 @@ +# Streamdevice protocol file for the PSI SLS VME magnet controller used at AMOR + +InTerminator = "\n"; +OutTerminator = "\r\n"; +#ExtraInput = Ignore; + +read { + out "r \$1 \$2"; + in "\$1 \$2 %f"; +} + +readErrTxt { + out "r \$1 errtext"; + in "\$1 errtext %s"; +} + + +write { + out "w \$1 \$2 %f"; + in "OK"; +} + +readonoff { + out "r \$1 onoff"; + in "\$1 onoff %{off|on}"; +} + +setpower { + out "w \$1 %{on|off}"; + in "OK"; +} \ No newline at end of file diff --git a/sinqEPICSApp/src/Makefile b/sinqEPICSApp/src/Makefile index 0fe44f3..e33e44e 100644 --- a/sinqEPICSApp/src/Makefile +++ b/sinqEPICSApp/src/Makefile @@ -20,7 +20,7 @@ sinqEPICS_DBD += sinq.dbd #sinqEPICS_DBD += pmacAsynIPPort.dbd pmacAsynMotorPort.dbd # Add all the support libraries needed by this IOC -sinqEPICS_LIBS += motor asyn busy synAppsStd +sinqEPICS_LIBS += motor asyn busy synAppsStd streamdevice pcre # sinqEPICS_registerRecordDeviceDriver.cpp derives from sinqEPICS.dbd sinqEPICS_SRCS += sinqEPICS_registerRecordDeviceDriver.cpp diff --git a/sinqEPICSApp/src/sinq.dbd b/sinqEPICSApp/src/sinq.dbd index e9b3777..21719b1 100644 --- a/sinqEPICSApp/src/sinq.dbd +++ b/sinqEPICSApp/src/sinq.dbd @@ -16,7 +16,7 @@ include "synAppsStd.dbd" device(scaler,INST_IO,devScalerEL737,"asynScalerEL737") #--------- For lakeshore -#addpath "/opt/epics/modules/streamdevice/2.6.0/3.14.12.5/dbd" -#include "streamdevice.dbd" +addpath "/opt/epics/modules/streamdevice/2.6.0/3.14.12.5/dbd" +include "streamdevice.dbd" addpath "/opt/epics/modules/busy/1.6.0/3.14.12.5/dbd" include "busy.dbd"