]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
FLOW_METER: .proto .db and other requirements
authorPhilipp Klaus <philipp.klaus@gmail.com>
Fri, 21 Jul 2017 15:03:53 +0000 (17:03 +0200)
committerPhilipp Klaus <philipp.klaus@gmail.com>
Fri, 21 Jul 2017 15:03:53 +0000 (17:03 +0200)
FLOW_METER/FLOW_METERApp/Db/FLOW_METER.substitutions [new file with mode: 0644]
FLOW_METER/FLOW_METERApp/Db/FLOW_METER.template [new file with mode: 0644]
FLOW_METER/FLOW_METERApp/Db/Makefile
FLOW_METER/FLOW_METERApp/src/Makefile
FLOW_METER/configure/RELEASE
FLOW_METER/iocBoot/iocFLOW_METER/st.cmd
FLOW_METER/protocols/FLOW_METER.proto [new file with mode: 0644]

diff --git a/FLOW_METER/FLOW_METERApp/Db/FLOW_METER.substitutions b/FLOW_METER/FLOW_METERApp/Db/FLOW_METER.substitutions
new file mode 100644 (file)
index 0000000..8df2b9e
--- /dev/null
@@ -0,0 +1,8 @@
+
+file FLOW_METER.template {
+
+pattern { REC }
+        { "A" }
+        { "B" }
+}
+
diff --git a/FLOW_METER/FLOW_METERApp/Db/FLOW_METER.template b/FLOW_METER/FLOW_METERApp/Db/FLOW_METER.template
new file mode 100644 (file)
index 0000000..4662b2f
--- /dev/null
@@ -0,0 +1,35 @@
+#############################################
+# ###                                   ### #
+# ### 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")
+}
index 983981d401b27c05644f2f2cc19cbf888f053bf3..e870093b33d9f67eee9194bf48722d6ea229faf4 100644 (file)
@@ -11,6 +11,7 @@ include $(TOP)/configure/CONFIG
 # 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
index 0695380fa2014d28572ca02f2bdb0d94c051dce2..b4dfa73efb46c6315635ec05bd1f42be2e1d8500 100644 (file)
@@ -14,12 +14,17 @@ DBD += FLOW_METER.dbd
 
 # 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
index bd6b780b1ca1620a0b61ddf3a126e3a14a4819d6..b807a14bfe3ede5180f8bed60012db83e4e4e98c 100644 (file)
 
 # 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
index 6d4b1cb8d2d4dea4aa3d2a3ea00da359e84b9526..d8ae047d904ce10be2998888b2bb8a05603e367c 100644 (file)
@@ -5,15 +5,27 @@
 
 < 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
 
diff --git a/FLOW_METER/protocols/FLOW_METER.proto b/FLOW_METER/protocols/FLOW_METER.proto
new file mode 100644 (file)
index 0000000..acb240d
--- /dev/null
@@ -0,0 +1,39 @@
+#################################################
+# ###                                       ### #
+# ### 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";
+}
+