# 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
--- /dev/null
+file PT100_BOARD.template {
+
+pattern { ID }
+ { "00" }
+ { "01" }
+ { "02" }
+ { "03" }
+ { "04" }
+ { "05" }
+ { "06" }
+ { "07" }
+}
--- /dev/null
+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")
+}
# 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
# 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
< 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
--- /dev/null
+###################################################
+# ### ### #
+# ### 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";
+}