initial sketch of mdif stream device module
This commit is contained in:
19
Makefile
Normal file
19
Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
# This build the sinq extensions for the PSI EPICS setup
|
||||
include /ioc/tools/driver.makefile
|
||||
|
||||
MODULE=mdif
|
||||
BUILDCLASSES=Linux
|
||||
EPICS_VERSIONS=7.0.7
|
||||
ARCH_FILTER=RHEL%
|
||||
|
||||
# additional module dependencies
|
||||
REQUIRED+=asyn
|
||||
REQUIRED+=stream
|
||||
|
||||
# DB files to include in the release
|
||||
TEMPLATES += db/mdif.db
|
||||
TEMPLATES += db/mdif.proto
|
||||
|
||||
SCRIPTS += scripts/mdif.cmd
|
||||
|
||||
# MISCS would be the place to keep the stream device template files
|
||||
21
db/mdif.db
Normal file
21
db/mdif.db
Normal file
@@ -0,0 +1,21 @@
|
||||
record(stringin, "$(INSTR)$(NAME):MsgTxt")
|
||||
{
|
||||
field(DESC, "Unexpected received response")
|
||||
field(DTYP, "devDAQStringError")
|
||||
field(FLNK, "$(INSTR)$(NAME):INVALID-CONFIG")
|
||||
}
|
||||
|
||||
record(longout,"$(INSTR)$(NAME):DELAY")
|
||||
{
|
||||
field(DESC, "Starting measurement time after trigger signal")
|
||||
field(DTYP, "stream")
|
||||
field(OUT, "@$(PROTO) writeDelay($(INSTR)$(NAME):) $(ASYN_PORT)")
|
||||
}
|
||||
|
||||
record(longin,"$(INSTR)$(NAME):DELAY")
|
||||
{
|
||||
field(DESC, "Starting measurement time after trigger signal")
|
||||
field(DTYP, "stream")
|
||||
field(OUT, "@$(PROTO) readDelay($(INSTR)$(NAME):) $(ASYN_PORT)")
|
||||
field(SCAN, "1 second")
|
||||
}
|
||||
25
db/mdif.proto
Normal file
25
db/mdif.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
OutTerminator = CR;
|
||||
InTerminator = CR;
|
||||
ReadTimeout = 100;
|
||||
WriteTimeout = 100;
|
||||
ReplyTimeout = 1000;
|
||||
LockTimeout = 1000;
|
||||
|
||||
initialise {
|
||||
out "RMT 1"; # Turn on Remote Control
|
||||
in;
|
||||
out "ECHO 0"; # Ask for reponses
|
||||
in;
|
||||
}
|
||||
|
||||
readDelay {
|
||||
out "DT";
|
||||
in "%d";
|
||||
@mismatch{in "%(\$1MsgTxt)s";}
|
||||
}
|
||||
|
||||
writeDelay {
|
||||
out "DT %d";
|
||||
in;
|
||||
@mismatch{in "%(\$1MsgTxt)s";}
|
||||
}
|
||||
6
scripts/mdif.cmd
Normal file
6
scripts/mdif.cmd
Normal file
@@ -0,0 +1,6 @@
|
||||
require asyn
|
||||
require stream
|
||||
|
||||
epicsEnvSet("PROTO", "$(mdif_DB)mdif.proto")
|
||||
drvAsynIPPortConfigure("ASYN_$(NAME)", "$(HOST)", 0, 0, 0)
|
||||
dbLoadRecords("$(mdif_DB)mdif.db", "INSTR=$(INSTR), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=ASYN_$(NAME)")
|
||||
Reference in New Issue
Block a user