--- /dev/null
+#############################################
+# ### ### #
+# ### 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")
+}
+
# ### 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")
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")
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")
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")
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")
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")
#}
--- /dev/null
+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"}
+}
--- /dev/null
+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)")
+}
--- /dev/null
+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."}
+}
+
--- /dev/null
+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)")
+}
# Create and install (or just install) into <top>/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 <anyname>.db template is not named <anyname>*.template add
## 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
--- /dev/null
+#################################################
+# ### ### #
+# ### 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";
+# }
+#}
+#
in "TE %d";
}
+getVersion {
+ out "[M01V07C6";
+ in "[S01V%*02X%6c%*02X";
+}
+
+getFirmware {
+ out "[M01F07B6";
+ in "[S01F%*02X%8c%*02X";
+}
+
+
#--------------------------------------------------------------------------------
enableCirculation {