--- /dev/null
+
+file FLOW_METER.template {
+
+pattern { REC }
+ { "A" }
+ { "B" }
+}
+
--- /dev/null
+#############################################
+# ### ### #
+# ### EPICS Database for ### #
+# ### FLOW_METER ### #
+# ### ### #
+# ### author: P.Klaus ### #
+# ### ### #
+# ### Ref 1.0; 2017-07-21 ### #
+# ### ### #
+# ### macros: ### #
+# ### sys system ### #
+# ### sub subsystem ### #
+# ### csys cooling sub system ### #
+# ### PORT Asyn Interface ### #
+#############################################
+
+record (ai, "$(sys):$(sub):COOLING:$(csys):FLOW:$(REC):Flow") {
+ field (DTYP, "stream")
+ field (INP, "@FLOW_METER.proto flow_$(REC) $(PORT)")
+ field (SCAN, "I/O Intr")
+ field (EGU, "l/min")
+ field (PREC, "3")
+ #field (ADEL, "0.07")
+ #field (MDEL, "0.01")
+}
+
+record (ai, "$(sys):$(sub):COOLING:$(csys):FLOW:$(REC):Total") {
+ field (DTYP, "stream")
+ field (INP, "@FLOW_METER.proto total_$(REC) $(PORT)")
+ field (SCAN, "I/O Intr")
+ field (EGU, "l")
+ field (PREC, "3")
+ #field (ADEL, "0.1")
+ #field (MDEL, "0.01")
+}
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
#DB += xxx.db
+DB += FLOW_METER.db
#----------------------------------------------------
# If <anyname>.db template is not named <anyname>*.template add
# FLOW_METER.dbd will be made up from these files:
FLOW_METER_DBD += base.dbd
+FLOW_METER_DBD += stream.dbd
+FLOW_METER_DBD += asyn.dbd
+FLOW_METER_DBD += drvAsynSerialPort.dbd
# Include dbd files from all support applications:
#FLOW_METER_DBD += xxx.dbd
# Add all the support libraries needed by this IOC
#FLOW_METER_LIBS += xxx
+FLOW_METER_LIBS += stream
+FLOW_METER_LIBS += asyn
# FLOW_METER_registerRecordDeviceDriver.cpp derives from FLOW_METER.dbd
FLOW_METER_SRCS += FLOW_METER_registerRecordDeviceDriver.cpp
# Variables and paths to dependent modules:
#MODULES = /path/to/modules
+MODULES = /home/scs/EPICS/EPICS/modules
#MYMODULE = $(MODULES)/my-module
-
+
# If using the sequencer, point SNCSEQ at its top directory:
-#SNCSEQ = $(MODULES)/seq-ver
+SNCSEQ = $(MODULES)/synApps_5_8/support/seq-2-2-1
+ASYN = $(MODULES)/synApps_5_8/support/asyn-4-26
+STREAM = $(MODULES)/synApps_5_8/support/stream-2-6a
# EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE = /home/scs/EPICS/EPICS/base
< envPaths
+epicsEnvSet ("STREAM_PROTOCOL_PATH", "${TOP}/protocols")
+
cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/FLOW_METER.dbd"
FLOW_METER_registerRecordDeviceDriver pdbbase
+drvAsynSerialPortConfigure("FLOW_METER_PORT","/dev/SparkFun_Pro_Micro_platform-3f980000.usb-usb-0:1.5:1.0")
+asynSetOption ("FLOW_METER_PORT", 0, "baud", "115200")
+asynSetOption ("FLOW_METER_PORT", 0, "bits", "8")
+asynSetOption ("FLOW_METER_PORT", 0, "parity", "none")
+asynSetOption ("FLOW_METER_PORT", 0, "stop", "1")
+asynSetOption ("FLOW_METER_PORT", 0, "clocal", "N")
+asynSetOption ("FLOW_METER_PORT", 0, "crtscts", "N")
+
## Load record instances
#dbLoadRecords("db/xxx.db","user=scs")
+dbLoadRecords("db/FLOW_METER.db", "PORT=FLOW_METER_PORT,sys=CBM,sub=MVD,csys=CC405")
+
cd "${TOP}/iocBoot/${IOC}"
iocInit
--- /dev/null
+#################################################
+# ### ### #
+# ### StreamDevice Protocol for ### #
+# ### FLOW_METER ### #
+# ### ### #
+# ### author: P.Klaus ### #
+# ### ### #
+# ### Ref 1.0; 2017-07-21 ### #
+#################################################
+
+###################
+# ### Globals ### #
+###################
+Terminator = LF;
+LockTimeout = 5000;
+ReplyTimeout = 500;
+ReadTimeout = 500;
+WriteTimeout = 300;
+ExtraInput = Ignore;
+
+#####################
+# ### Protocols ### #
+#####################
+
+
+flow_A {
+ in "F %*X %f";
+}
+total_A {
+ in "T %*X %f";
+}
+
+flow_B {
+ in "F %*X %f";
+}
+total_B {
+ in "T %*X %f";
+}
+