From: Ole Artz Date: Wed, 3 May 2017 14:06:14 +0000 (+0200) Subject: VACOM_MVC3: .proto .db first working version X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=328f9263924ca86e2c2f4d85612a53f831bea751;p=mvd_epics.git VACOM_MVC3: .proto .db first working version --- diff --git a/VACOM_MVC3/VACOM_MVC3App/Db/Makefile b/VACOM_MVC3/VACOM_MVC3App/Db/Makefile index 983981d..a36420b 100644 --- a/VACOM_MVC3/VACOM_MVC3App/Db/Makefile +++ b/VACOM_MVC3/VACOM_MVC3App/Db/Makefile @@ -11,6 +11,7 @@ include $(TOP)/configure/CONFIG # Create and install (or just install) into /db # databases, templates, substitutions like this #DB += xxx.db +DB += VACOM_MVC3.db #---------------------------------------------------- # If .db template is not named *.template add diff --git a/VACOM_MVC3/VACOM_MVC3App/Db/VACOM_MVC3.db b/VACOM_MVC3/VACOM_MVC3App/Db/VACOM_MVC3.db new file mode 100644 index 0000000..f667f54 --- /dev/null +++ b/VACOM_MVC3/VACOM_MVC3App/Db/VACOM_MVC3.db @@ -0,0 +1,30 @@ +############################################# +# ### ### # +# ### EPICS Database for ### # +# ### VACOM_MVC3 ### # +# ### ### # +# ### author: O.Artz ### # +# ### P.Klaus ### # +# ### ### # +# ### Ref 1.0; 2017-05-03 ### # +# ### ### # +# ### macros: ### # +# ### sys system ### # +# ### sub subsystem ### # +# ### vsys vacuum sub system ### # +# ### PORT Asyn Interface ### # +############################################# + +record (ai, "$(sys):$(sub):VACUUM:$(vsys):Pressure") { + field (DTYP, "stream") + field (INP, "@VACOM_MVC3.proto getPressureValue2 $(PORT)") + field (SCAN, "10 second") + #field (FLNK, "PANDA:$(subsys):COOLING:$(sector):getExtTemp") + field (EGU, "mbar") + #field (PREC, "2") + #field (ADEL, "1") + #field (MDEL, "1") + #field (ASLO, "0.01") + #field (AOFF, "0") +} + diff --git a/VACOM_MVC3/VACOM_MVC3App/src/Makefile b/VACOM_MVC3/VACOM_MVC3App/src/Makefile index 0f88814..57147b7 100644 --- a/VACOM_MVC3/VACOM_MVC3App/src/Makefile +++ b/VACOM_MVC3/VACOM_MVC3App/src/Makefile @@ -14,12 +14,17 @@ DBD += VACOM_MVC3.dbd # VACOM_MVC3.dbd will be made up from these files: VACOM_MVC3_DBD += base.dbd +VACOM_MVC3_DBD += stream.dbd +VACOM_MVC3_DBD += asyn.dbd +VACOM_MVC3_DBD += drvAsynSerialPort.dbd # Include dbd files from all support applications: #VACOM_MVC3_DBD += xxx.dbd # Add all the support libraries needed by this IOC #VACOM_MVC3_LIBS += xxx +VACOM_MVC3_LIBS += stream +VACOM_MVC3_LIBS += asyn # VACOM_MVC3_registerRecordDeviceDriver.cpp derives from VACOM_MVC3.dbd VACOM_MVC3_SRCS += VACOM_MVC3_registerRecordDeviceDriver.cpp diff --git a/VACOM_MVC3/configure/RELEASE b/VACOM_MVC3/configure/RELEASE index bd6b780..9dc0e93 100644 --- a/VACOM_MVC3/configure/RELEASE +++ b/VACOM_MVC3/configure/RELEASE @@ -24,10 +24,14 @@ # 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 diff --git a/VACOM_MVC3/iocBoot/iocVACOM_MVC3/st.cmd b/VACOM_MVC3/iocBoot/iocVACOM_MVC3/st.cmd index 868745c..d57a7cb 100644 --- a/VACOM_MVC3/iocBoot/iocVACOM_MVC3/st.cmd +++ b/VACOM_MVC3/iocBoot/iocVACOM_MVC3/st.cmd @@ -4,6 +4,7 @@ ## everywhere it appears in this file < envPaths +epicsEnvSet ("STREAM_PROTOCOL_PATH", "${TOP}/protocols") cd "${TOP}" @@ -11,8 +12,20 @@ cd "${TOP}" dbLoadDatabase "dbd/VACOM_MVC3.dbd" VACOM_MVC3_registerRecordDeviceDriver pdbbase +drvAsynSerialPortConfigure("HUBER_PORT","/dev/ttyUSB0") +asynSetOption ("HUBER_PORT", 0, "baud", "19200") +asynSetOption ("HUBER_PORT", 0, "bits", "8") +asynSetOption ("HUBER_PORT", 0, "parity", "none") +asynSetOption ("HUBER_PORT", 0, "stop", "1") +asynSetOption ("HUBER_PORT", 0, "clocal", "N") +asynSetOption ("HUBER_PORT", 0, "crtscts", "N") + +#lots! of debug output +#var streamDebug 1 + ## Load record instances #dbLoadRecords("db/xxx.db","user=scs") +dbLoadRecords("db/VACOM_MVC3.db","PORT=HUBER_PORT,sys=CBM,sub=MVD,vsys=RECIPIENT") cd "${TOP}/iocBoot/${IOC}" iocInit diff --git a/VACOM_MVC3/protocols/VACOM_MVC3.proto b/VACOM_MVC3/protocols/VACOM_MVC3.proto new file mode 100644 index 0000000..efc1065 --- /dev/null +++ b/VACOM_MVC3/protocols/VACOM_MVC3.proto @@ -0,0 +1,31 @@ +################################################# +# ### ### # +# ### StreamDevice Protocol for ### # +# ### VACOM_MVC3 ### # +# ### ### # +# ### author: O.Artz ### # +# ### P.Klaus ### # +# ### ### # +# ### Ref 1.0; 2017-05-03 ### # +################################################# + +################### +# ### Globals ### # +################### +Terminator = CR; +LockTimeout = 5000; +ReplyTimeout = 500; +ReadTimeout = 500; +WriteTimeout = 300; +ExtraInput = Ignore; + +##################### +# ### Protocols ### # +##################### + + +getPressureValue2 { + out "RPV2"; + in "%*d,\t%e"; +} +