]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
Pt100 Board: Added .proto, .template, .substitutions; working
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Wed, 12 Apr 2017 13:26:01 +0000 (15:26 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Wed, 12 Apr 2017 13:26:01 +0000 (15:26 +0200)
PT100_BOARD/PT100_BOARDApp/Db/Makefile
PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.substitutions [new file with mode: 0644]
PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.template [new file with mode: 0644]
PT100_BOARD/PT100_BOARDApp/src/Makefile
PT100_BOARD/configure/RELEASE
PT100_BOARD/iocBoot/iocPT100_BOARD/st.cmd [changed mode: 0644->0755]
PT100_BOARD/protocols/PT100_BOARD.proto [new file with mode: 0644]

index 983981d401b27c05644f2f2cc19cbf888f053bf3..5481f63d39ca3efce770c4c3ca7dc15b3981acb4 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 += PT100_BOARD.db
 
 #----------------------------------------------------
 # If <anyname>.db template is not named <anyname>*.template add
diff --git a/PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.substitutions b/PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.substitutions
new file mode 100644 (file)
index 0000000..93c757a
--- /dev/null
@@ -0,0 +1,12 @@
+file PT100_BOARD.template {
+
+pattern { ID }
+       { "00" }
+       { "01" }
+       { "02" }
+       { "03" }
+       { "04" }
+       { "05" }
+       { "06" }
+       { "07" }
+}
diff --git a/PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.template b/PT100_BOARD/PT100_BOARDApp/Db/PT100_BOARD.template
new file mode 100644 (file)
index 0000000..8d85829
--- /dev/null
@@ -0,0 +1,17 @@
+record(ai, "$(sys):$(sub):PT100:$(ptsys):$(ID):RAW") {
+  field(DTYP, "stream")
+  field(INP, "@PT100_BOARD.proto getTemperature($(ID)) $(PORT)")
+  field(SCAN, "I/O Intr")
+  field(FLNK, "$(sys):$(sub):PT100:$(ptsys):$(ID)")
+}
+
+record(calc, "$(sys):$(sub):PT100:$(ptsys):$(ID)") {
+  field(CALC, "A&0x100000?NaN:(A&0x80000?(A-0x100000)/1000.:A/1000.)")
+  field(INPA, "$(sys):$(sub):PT100:$(ptsys):$(ID):RAW.VAL")
+  field(EGU, "deg C")
+  field(PREC, "3")
+  field(ADEL, "0.02")
+  field(MDEL, "0.02")
+  field(HOPR, "100.0")
+  field(LOPR, "-50.0")
+}
index 09daf3cb3861e38856b7987e05123b9f685c9329..69bde3c42bb236d84d9c27263794352e7069fa79 100644 (file)
@@ -14,12 +14,17 @@ DBD += PT100_BOARD.dbd
 
 # PT100_BOARD.dbd will be made up from these files:
 PT100_BOARD_DBD += base.dbd
+PT100_BOARD_DBD += stream.dbd
+PT100_BOARD_DBD += asyn.dbd
+PT100_BOARD_DBD += drvAsynSerialPort.dbd
 
 # Include dbd files from all support applications:
 #PT100_BOARD_DBD += xxx.dbd
 
 # Add all the support libraries needed by this IOC
 #PT100_BOARD_LIBS += xxx
+PT100_BOARD_LIBS += stream
+PT100_BOARD_LIBS += asyn
 
 # PT100_BOARD_registerRecordDeviceDriver.cpp derives from PT100_BOARD.dbd
 PT100_BOARD_SRCS += PT100_BOARD_registerRecordDeviceDriver.cpp
index bd6b780b1ca1620a0b61ddf3a126e3a14a4819d6..80e3de21a29f320b31692b6c58b33cd7d116b8cb 100644 (file)
 # the CONFIG_SITE 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
old mode 100644 (file)
new mode 100755 (executable)
index e4bdcb4..43e9716
@@ -5,14 +5,28 @@
 
 < envPaths
 
+epicsEnvSet ("STREAM_PROTOCOL_PATH", "${TOP}/protocols")
+
 cd "${TOP}"
 
 ## Register all support components
 dbLoadDatabase "dbd/PT100_BOARD.dbd"
 PT100_BOARD_registerRecordDeviceDriver pdbbase
 
+drvAsynSerialPortConfigure("PT100_PORT","/dev/ttyUSB1")
+asynSetOption ("PT100_PORT", 0, "baud", "38400")
+asynSetOption ("PT100_PORT", 0, "bits", "8")
+asynSetOption ("PT100_PORT", 0, "parity", "none")
+asynSetOption ("PT100_PORT", 0, "stop", "1")
+asynSetOption ("PT100_PORT", 0, "clocal", "N")
+asynSetOption ("PT100_PORT", 0, "crtscts", "N")
+
+#lots! of debug output
+#var streamDebug 1
+
 ## Load record instances
 #dbLoadRecords("db/xxx.db","user=scs")
+dbLoadRecords("db/PT100_BOARD.db","PORT=PT100_PORT,sys=CBM,sub=MVD,ptsys=VAC")
 
 cd "${TOP}/iocBoot/${IOC}"
 iocInit
diff --git a/PT100_BOARD/protocols/PT100_BOARD.proto b/PT100_BOARD/protocols/PT100_BOARD.proto
new file mode 100644 (file)
index 0000000..f1af9c8
--- /dev/null
@@ -0,0 +1,28 @@
+###################################################
+# ###                                         ### #
+# ### StreamDevice Protocol for               ### #
+# ### Pt100 Board by JMichel MWiebusch PKlaus ### #
+# ###                                         ### #
+# ### author: P.Klaus                         ### #
+# ###                                         ### #
+# ### Ref 1.0; 2017-04-12                     ### #
+###################################################
+
+###################
+# ### Globals ### #
+###################
+Terminator    = LF;
+LockTimeout   = 5000;
+ReplyTimeout  = 500;
+ReadTimeout   = 500;
+WriteTimeout  = 300;
+ExtraInput    = Ignore;
+
+#####################
+# ### Protocols ### #
+#####################
+
+getTemperature {
+  #in  "AT1300631b SP %d";
+  in  "AT\$1%#06x";
+}