Added support for the dimetix distance measurement device
Refs #DM-93
This commit is contained in:
34
iocBoot/iocsinqEPICS/stdimetix.cmd
Executable file
34
iocBoot/iocsinqEPICS/stdimetix.cmd
Executable file
@ -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"
|
40
sinqEPICSApp/Db/dimetix.db
Normal file
40
sinqEPICSApp/Db/dimetix.db
Normal file
@ -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")
|
||||
}
|
||||
|
23
sinqEPICSApp/Db/dimetix.proto
Normal file
23
sinqEPICSApp/Db/dimetix.proto
Normal file
@ -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"}
|
||||
}
|
||||
|
Reference in New Issue
Block a user