From: Philipp Klaus Date: Fri, 5 May 2017 12:01:51 +0000 (+0200) Subject: HUBER_COOLING: Splitting the IOC into PP/LAI protocols X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5e44cc11e05e5016bace3122a5493dac5e1350b4;p=mvd_epics.git HUBER_COOLING: Splitting the IOC into PP/LAI protocols --- diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_LAI.db b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_LAI.db new file mode 100644 index 0000000..d8444f5 --- /dev/null +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_LAI.db @@ -0,0 +1,153 @@ +############################################# +# ### ### # +# ### EPICS Database for ### # +# ### Huber Unistate 425 ### # +# ### ### # +# ### author: F.Feldbauer ### # +# ### R.Kieser ### # +# ### ### # +# ### Ref 1.0; 2014-01-07 ### # +# ### ### # +# ### macros: ### # +# ### sys system ### # +# ### sub subsystem ### # +# ### csys cooling sub system ### # +# ### PORT Asyn Interface ### # +############################################# + +record (stringin, "$(sys):$(sub):COOLING:$(csys):Verify") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getVerify $(PORT)") + field (PINI, "YES") +} + +record (stringin, "$(sys):$(sub):COOLING:$(csys):Firmware") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getFirmware $(PORT)") + field (PINI, "YES") +} + +record (mbbi , "$(sys):$(sub):COOLING:$(csys):State") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getState $(PORT)") + field (SCAN, "5 second") + field (PINI, "YES") + field (ZRST, "OFF") + field (ONST, "INTERNAL") + field (TWST, "EXTERNAL") + field (THST, "CIRCULATION") +} + +record (ai, "$(sys):$(sub):COOLING:$(csys):SetpointMom:RAW") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getSetpoint $(PORT)") + field (SCAN, "I/O Intr") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):SetpointMom") +} + +record (calc, "$(sys):$(sub):COOLING:$(csys):SetpointMom") { + field(CALC, "A&0x100000?NaN:(A&0x80000?(A-0x100000)/100.:A/100.)") + field(INPA, "$(sys):$(sub):COOLING:$(csys):SetpointMom: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") +} + +#record (waveform, "$(sys):$(sub):COOLING:$(csys):STAT1:RAW") { +# field (DTYP, "stream") +# field (INP, "@Huber_LAI.proto getStatOne $(PORT)") +# field (PINI, "YES") +# field (SCAN, "5 second") +# field (FTVL, "ULONG") +# field (NELM, "5") +# field(PREC, "0") +#} + + +# Stat 1 +record (longin, "$(sys):$(sub):COOLING:$(csys):T0:RAW") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getStat1($(sys):$(sub):COOLING:$(csys)) $(PORT)") + field (SCAN, "5 second") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):T0") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):TC:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TC") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):T1:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):T1") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):TIntern:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TIntern") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):TProcess:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TProcess") +} + +# Stat 2 +record (longin, "$(sys):$(sub):COOLING:$(csys):V:RAW") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getStat2($(sys):$(sub):COOLING:$(csys)) $(PORT)") + field (SCAN, "5 second") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):V") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):HT:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):HT") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):Heating:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):Heating") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):F:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):F") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):I:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):I") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):unknown1:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):unknown1") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):unknown2:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):unknown2") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):AIF_IN:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):AIF_IN") +} + +# Stat 3 +record (longin, "$(sys):$(sub):COOLING:$(csys):TU:RAW") { + field (DTYP, "stream") + field (INP, "@Huber_LAI.proto getStat3($(sys):$(sub):COOLING:$(csys)) $(PORT)") + field (SCAN, "5 second") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TU") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):TX1:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TX1") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):TX0:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):TX0") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):Pressure:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):Pressure") +} +record (longin, "$(sys):$(sub):COOLING:$(csys):PumpSpeed:RAW") { + field (DTYP, "Soft Channel") + field(FLNK, "$(sys):$(sub):COOLING:$(csys):PumpSpeed") +} + diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Unistate_425.db b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_PP.db similarity index 74% rename from HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Unistate_425.db rename to HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_PP.db index 60fd339..b5b3ca2 100644 --- a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Unistate_425.db +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_PP.db @@ -15,23 +15,23 @@ # ### PORT Asyn Interface ### # ############################################# -record (ai, "$(sys):$(sub):COOLING:$(csys):SetpointMom") { - field (DTYP, "stream") - field (INP, "@Huber_Unistate_425.proto getDesVal $(PORT)") - field (PINI, "YES") - field (EGU, "°C") - field (PREC, "2") - field (ADEL, "0.05") - field (MDEL, "0.05") - field (ASLO, "0.01") - field (AOFF, "0") - field (HOPR, "100.0") - field (LOPR, "-50.0") -} +#record (ai, "$(sys):$(sub):COOLING:$(csys):SetpointMom") { +# field (DTYP, "stream") +# field (INP, "@Huber_PP.proto getDesVal $(PORT)") +# field (PINI, "YES") +# field (EGU, "°C") +# field (PREC, "2") +# field (ADEL, "0.05") +# field (MDEL, "0.05") +# field (ASLO, "0.01") +# field (AOFF, "0") +# field (HOPR, "100.0") +# field (LOPR, "-50.0") +#} record (ai, "$(sys):$(sub):COOLING:$(csys):BathTemperatureMom") { field (DTYP, "stream") - field (INP, "@Huber_Unistate_425.proto getBathTemp $(PORT)") + field (INP, "@Huber_PP.proto getBathTemp $(PORT)") field (SCAN, "2 second") field (FLNK, "$(sys):$(sub):COOLING:$(csys):ExternalTemperatureMom") field (EGU, "°C") @@ -50,7 +50,7 @@ record (ai, "$(sys):$(sub):COOLING:$(csys):BathTemperatureMom") { record (ai, "$(sys):$(sub):COOLING:$(csys):ExternalTemperatureMom") { field (DTYP, "stream") - field (INP, "@Huber_Unistate_425.proto getExtTemp $(PORT)") + field (INP, "@Huber_PP.proto getExtTemp $(PORT)") field (FLNK, "$(sys):$(sub):COOLING:$(csys):SetpointMom") field (EGU, "°C") field (PREC, "2") @@ -66,7 +66,7 @@ record (ai, "$(sys):$(sub):COOLING:$(csys):ExternalTemperatureMom") { record (ao, "$(sys):$(sub):COOLING:$(csys):Setpoint") { field (DTYP, "stream") - field (OUT, "@Huber_Unistate_425.proto setDesVal $(PORT)") + field (OUT, "@Huber_PP.proto setDesVal $(PORT)") field (EGU, "°C") field (PREC, "2") field (ADEL, "0.05") @@ -75,12 +75,14 @@ record (ao, "$(sys):$(sub):COOLING:$(csys):Setpoint") { field (AOFF, "0") field (HOPR, "100.0") field (LOPR, "-50.0") +# field (HOPR, "$(sys):$(sub):COOLING:$(csys):MaximumValue") +# field (LOPR, "$(sys):$(sub):COOLING:$(csys):MinimumValue") field (FLNK, "$(sys):$(sub):COOLING:$(csys):SetpointMom") } record (ao , "$(sys):$(sub):COOLING:$(csys):MinimumValue") { field (DTYP, "stream") - field (OUT, "@Huber_Unistate_425.proto setMinVal $(PORT)") + field (OUT, "@Huber_PP.proto setMinVal $(PORT)") field (EGU, "°C") field (PREC, "2") field (ADEL, "0.05") @@ -91,7 +93,7 @@ record (ao , "$(sys):$(sub):COOLING:$(csys):MinimumValue") { record (ao, "$(sys):$(sub):COOLING:$(csys):MaximumValue") { field (DTYP, "stream") - field (OUT, "@Huber_Unistate_425.proto setMaxVal $(PORT)") + field (OUT, "@Huber_PP.proto setMaxVal $(PORT)") field (EGU, "°C") field (PREC, "2") field (ADEL, "0.05") @@ -102,15 +104,16 @@ record (ao, "$(sys):$(sub):COOLING:$(csys):MaximumValue") { record (bo , "$(sys):$(sub):COOLING:$(csys):TemperatureControl") { field (DTYP, "stream") - field (OUT, "@Huber_Unistate_425.proto setTempCtrl $(PORT)") + field (OUT, "@Huber_PP.proto setTempCtrl $(PORT)") field (ZNAM, "OFF") field (ONAM, "ON") field (PINI, "YES") +# field (FLNK, "$(sys):$(sub):COOLING:$(csys):TemperatureMode") } #record (bo, "$(sys):$(sub):COOLING:$(csys):TemperatureMode") { # field (DTYP, "stream") -# field (OUT, "@Huber_Unistate_425.proto setTempMode $(PORT)") +# field (OUT, "@Huber_PP.proto setTempMode $(PORT)") # field (ZNAM, "INTERN") # field (ONAM, "EXTERN") #} diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.substitutions b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.substitutions new file mode 100644 index 0000000..2c81ae3 --- /dev/null +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.substitutions @@ -0,0 +1,10 @@ +file Huber_Z2.template { + +pattern { REC, EGU, OFFSET, LOPR, HOPR } + { "V" "%" 0, "0" "100"} + { "HT" "" 0, "0" "255"} + { "Heating" "%" 0, "0" "100"} + { "unknown1" "" 0, "0" "255"} + { "unknown2" "" 0, "0" "255"} + { "F" "" -100, "-100" "155"} +} diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.template b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.template new file mode 100644 index 0000000..2635585 --- /dev/null +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z2.template @@ -0,0 +1,10 @@ +record (calc, "$(sys):$(sub):COOLING:$(csys):$(REC)") { + field(CALC, "A&0x8000?(A-0x10000)/100.:A+$(OFFSET)") + field(INPA, "$(sys):$(sub):COOLING:$(csys):$(REC):RAW.VAL") + field(EGU, "$(EGU)") + field(PREC, "0") + field(ADEL, "1") + field(MDEL, "1") + field(HOPR, "$(HOPR)") + field(LOPR, "$(LOPR)") +} diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.substitutions b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.substitutions new file mode 100644 index 0000000..04d04f3 --- /dev/null +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.substitutions @@ -0,0 +1,17 @@ +file Huber_Z3.template { + +pattern { REC, EGU, PREC, DIVIDER, DEL, LOPR, HOPR } + { "T0" "deg C" "2" "100." "0.02" "-40." "100."} + { "TC" "deg C" "2" "100." "0.02" "-40." "100."} + { "T1" "deg C" "2" "100." "0.02" "-40." "100."} + { "TIntern" "deg C" "2" "100." "0.02" "-40." "100."} + { "TProcess" "deg C" "2" "100." "0.02" "-40." "100."} + { "TU" "deg C" "2" "100." "0.02" "-40." "100."} + { "TX1" "deg C" "2" "100." "0.02" "-40." "100."} + { "TX0" "deg C" "2" "100." "0.02" "-40." "100."} + { "Pressure" "mbar" "0" "1." "2" "0." "4000."} + { "PumpSpeed" "rpm" "0" "1." "2" "0." "4500."} + { "I" "" "2" "100." "0.02" "0." "2000."} + { "AIF_IN" "%" "1" "10." "0.2" "0." "100."} +} + diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.template b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.template new file mode 100644 index 0000000..4c4951c --- /dev/null +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Huber_Z3.template @@ -0,0 +1,10 @@ +record (calc, "$(sys):$(sub):COOLING:$(csys):$(REC)") { + field(CALC, "A&0x8000?(A-0x10000)/100.:A/$(DIVIDER)") + field(INPA, "$(sys):$(sub):COOLING:$(csys):$(REC):RAW.VAL") + field(EGU, "$(EGU)") + field(PREC, "$(PREC)") + field(ADEL, "$(DEL)") + field(MDEL, "$(DEL)") + field(HOPR, "$(HOPR)") + field(LOPR, "$(LOPR)") +} diff --git a/HUBER_COOLING/HUBER_COOLINGApp/Db/Makefile b/HUBER_COOLING/HUBER_COOLINGApp/Db/Makefile index 3599a15..a607092 100644 --- a/HUBER_COOLING/HUBER_COOLINGApp/Db/Makefile +++ b/HUBER_COOLING/HUBER_COOLINGApp/Db/Makefile @@ -11,7 +11,10 @@ include $(TOP)/configure/CONFIG # Create and install (or just install) into /db # databases, templates, substitutions like this #DB += xxx.db -DB += Huber_Unistate_425.db +DB += Huber_PP.db +DB += Huber_LAI.db +DB += Huber_Z3.db +DB += Huber_Z2.db #---------------------------------------------------- # If .db template is not named *.template add diff --git a/HUBER_COOLING/iocBoot/iocHUBER_COOLING/st.cmd b/HUBER_COOLING/iocBoot/iocHUBER_COOLING/st.cmd index dc5c037..99a3674 100755 --- a/HUBER_COOLING/iocBoot/iocHUBER_COOLING/st.cmd +++ b/HUBER_COOLING/iocBoot/iocHUBER_COOLING/st.cmd @@ -26,7 +26,10 @@ asynSetOption ("HUBER_PORT", 0, "crtscts", "N") ## Load record instances #dbLoadRecords("db/xxx.db","user=scs") -dbLoadRecords("db/Huber_Unistate_425.db","PORT=HUBER_PORT,sys=CBM,sub=MVD,csys=CC405") +dbLoadRecords("db/Huber_PP.db", "PORT=HUBER_PORT,sys=CBM,sub=MVD,csys=CC405") +dbLoadRecords("db/Huber_LAI.db","PORT=HUBER_PORT,sys=CBM,sub=MVD,csys=CC405") +dbLoadRecords("db/Huber_Z2.db","PORT=HUBER_PORT,sys=CBM,sub=MVD,csys=CC405") +dbLoadRecords("db/Huber_Z3.db","PORT=HUBER_PORT,sys=CBM,sub=MVD,csys=CC405") cd "${TOP}/iocBoot/${IOC}" iocInit diff --git a/HUBER_COOLING/protocols/Huber_LAI.proto b/HUBER_COOLING/protocols/Huber_LAI.proto new file mode 100644 index 0000000..cc3888e --- /dev/null +++ b/HUBER_COOLING/protocols/Huber_LAI.proto @@ -0,0 +1,124 @@ +################################################# +# ### ### # +# ### StreamDevice Protocol for ### # +# ### Huber Unistat 425 ### # +# ### ### # +# ### author: F.Feldbauer ### # +# ### R.Kieser ### # +# ### ### # +# ### Ref 1.0; 2014-01-07 ### # +################################################# + +################### +# ### Globals ### # +################### +Terminator = CR; +LockTimeout = 5000; +ReplyTimeout = 500; +ReadTimeout = 500; +WriteTimeout = 300; +ExtraInput = Ignore; +Separator = ""; + +##################### +# ### Protocols ### # +##################### + +getVerify { + out "[M01V07C6"; + in "[S01V%*02X%6c%*02X"; +} + +getFirmware { + out "[M01F07B6"; +# in "[S01F%*02X%8c%*02X"; + in "%.1/\[S01F[[:xdigit:]]{2}(.*)[[:xdigit:]]{2}/"; +} + +getState { + out "[M01G0D******C0"; + #in "[S01G15I007D007D3C504CA"; + # O0083408C9C504CA + # O0083408CFC504D7 + # Input "O0083408CAC504D2" does not match format "%*02X#{OFF=79|INTERNAL=73|EXTERNAL=69|CIRCULATION=67}" + #in "%.1/\[S01G[[:xdigit:]]{2}(.*)[[:xdigit:]]{2}/"; + in "[S01G%*02X%{O|I|E|C}%*15c"; +} + +getSetpoint { + in "[S01G%*4c%04X%*10c"; +} + +getInternal { + in "[S01G%*8c%04X%*6c"; +} + +getExternal { + in "[S01G%*12c%04X%*2c"; +} + +getStat1 { + out "[M01S081F5"; + in "[S01S%*2c" + "1" + "%04X" + "%(\$1:TC:RAW.VAL)04X" + "%(\$1:T1:RAW.VAL)04X" + "%(\$1:TIntern:RAW.VAL)04X" + "%(\$1:TProcess:RAW.VAL)04X" + "%*2c"; +} + +getStat2 { + out "[M01S082F6"; + in "[S01S%*2c" + "2" + "%04X" + "%(\$1:V:RAW.VAL)02X" + "%(\$1:HT:RAW.VAL)02X" + "%(\$1:Heating:RAW.VAL)02X" + "%(\$1:F:RAW.VAL)02X" + "%(\$1:I:RAW.VAL)04X" + "%(\$1:unknown1:RAW.VAL)02X" + "%(\$1:unknown2:RAW.VAL)02X" + "%(\$1:AIF_IN:RAW.VAL)04X" + "%*2c"; +} + +getStat3 { + out "[M01S083F7"; + in "[S01S%*2c" + "3" + "%04X" + "%(\$1:TX1:RAW.VAL)04X" + "%(\$1:TX0:RAW.VAL)04X" + "%(\$1:Pressure:RAW.VAL)04X" + "%(\$1:PumpSpeed:RAW.VAL)04X" + "%*2c"; +} + +#getStatOne { +# out "[M01S081F5"; +# in "[S01S%*2c1%04X%*2c"; +#} + +#-------------------------------------------------------------------------------- + +enableCirculation { + out "%(HOPR)7.4f"; +} + +#setDesVal { +# # set a new setpoint +# # Example of command: +# # field (OUT, "@Huber_Unistat_425.proto setDesVal $(PORT)") +# +# out "SP@ %+06d"; +# in "SP %=+06d"; +# +# @init { +# out "SP?"; +# in "SP %d"; +# } +#} +# diff --git a/HUBER_COOLING/protocols/Huber_Unistate_425.proto b/HUBER_COOLING/protocols/Huber_PP.proto similarity index 95% rename from HUBER_COOLING/protocols/Huber_Unistate_425.proto rename to HUBER_COOLING/protocols/Huber_PP.proto index b50ec7d..1147377 100644 --- a/HUBER_COOLING/protocols/Huber_Unistate_425.proto +++ b/HUBER_COOLING/protocols/Huber_PP.proto @@ -50,6 +50,17 @@ getExtTemp { in "TE %d"; } +getVersion { + out "[M01V07C6"; + in "[S01V%*02X%6c%*02X"; +} + +getFirmware { + out "[M01F07B6"; + in "[S01F%*02X%8c%*02X"; +} + + #-------------------------------------------------------------------------------- enableCirculation {