diff --git a/iocBoot/iocsinqEPICS/stdimetix.cmd b/iocBoot/iocsinqEPICS/stdimetix.cmd new file mode 100755 index 0000000..5f9ef98 --- /dev/null +++ b/iocBoot/iocsinqEPICS/stdimetix.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 SPS +drvAsynIPPortConfigure("dimetix", "localhost:64000",0,0,0) +#drvAsynIPPortConfigure("slsvme", "localhost:8080",0,0,0) + +dbLoadRecords("$(ASYN)/db/asynRecord.db","P=SQ:AMOR:,R=dimetix,PORT=dimetix,ADDR=0,OMAX=80,IMAX=80") + +epicsEnvSet ("STREAM_PROTOCOL_PATH", "$(TOP)/sinqEPICSApp/Db:.") + +cd ${TOP}/iocBoot/iocsinqEPICS +dbLoadRecords("$(TOP)/sinqEPICSApp/Db/dimetix.db","PREFIX=SQ:AMOR:DIMETIX:") + + +iocInit + +## Start any sequence programs +#seq sncxxx,"user=koenneckeHost" diff --git a/sinqEPICSApp/Db/dimetix.db b/sinqEPICSApp/Db/dimetix.db new file mode 100644 index 0000000..00c5513 --- /dev/null +++ b/sinqEPICSApp/Db/dimetix.db @@ -0,0 +1,40 @@ + +# DB file for dimetix laser distance measurement device + +## +## Switch the laser +## +record(bo, "$(PREFIX)LASER") { + field(DESC, "Switch laser on and off") + field(DTYP,"stream") + field(OUT,"@dimetix.proto setlaser() dimetix 0") + field(PINI, "YES") + field(VAL, "0") + field(ZNAM, "OFF") + field(ONAM, "ON") +} + +## +## Read the distance +## +record(ai, "$(PREFIX)DIST") { + field(DTYP, "stream") + field(DESC, "Distance") + field(INP, "@dimetix.proto read() dimetix 0") + field(SCAN, "1 second") + field(PREC, "1") + field(EGU, "mm") +} + + +## +## Set the readback (for simulation purposes only) +## +record(ao, "$(PREFIX)SimVal") { + field(DTYP, "stream") + field(DESC, "Set readback for simulation") + field(OUT, "@dimetix.proto setreadback() dimetix 0") + field(PREC, "1") + field(EGU, "mm") +} + diff --git a/sinqEPICSApp/Db/dimetix.proto b/sinqEPICSApp/Db/dimetix.proto new file mode 100644 index 0000000..a744719 --- /dev/null +++ b/sinqEPICSApp/Db/dimetix.proto @@ -0,0 +1,23 @@ +# Streamdevice protocol file for a Dimetix distance measuring device as used at +# AMOR + +InTerminator = "\n"; +OutTerminator = "\r\n"; +ExtraInput = Ignore; + +setlaser { + out "%{s0p|s0o}"; + in "g0?"; +} + +setreadback { + out "setval %d"; + in "g0?"; +} + +read { + out "s0g"; + in "g0g+%d"; + @mismatch {in "@E213"} +} +