diff --git a/db/epluse.db b/db/epluse.db index 23c396d..5788a81 100644 --- a/db/epluse.db +++ b/db/epluse.db @@ -8,6 +8,15 @@ record(calcout, "$(PREFIX):FETCH") field(FLNK, "$(PREFIX):FANOUT") } +# This is some semi unqiue number each unit has +# needs to be configurable to per deployment. +record(longin, "$(PREFIX):UNIT-NUMBER") { + # Example neutra unit number + field(VAL, "$(UNIT_NUMBER=0xca8b)") + field(PINI, "YES") +} + + record(fanout, "$(PREFIX):FANOUT") { field(LNK1, "$(PREFIX):TEMP") field(LNK2, "$(PREFIX):RELHUM") diff --git a/db/epluse.proto b/db/epluse.proto index 2cb901d..06c3ff0 100644 --- a/db/epluse.proto +++ b/db/epluse.proto @@ -30,5 +30,5 @@ fetch_rht { # I try to handle this with with ?*c command, but it doesn't work # Possibly check with Dirk sometime how to make this work, if possible # For now ignore extra data - in 0xca 0x8b 0x67 0x0A 0x06 0x00 "%(A)#R%(B)#R%"; + in "%(\$1:UNIT-NUMBER)2r" 0x67 0x0A 0x06 0x00 "%(A)#R%(B)#R%"; } diff --git a/epluse.cmd b/epluse.cmd index 91927e4..5ccc766 100644 --- a/epluse.cmd +++ b/epluse.cmd @@ -1,4 +1,3 @@ -require asyn require stream # Parameterized snippet to load support for the eplue EE31 environmental sensor used at ICON and Neutra. @@ -13,4 +12,4 @@ epicsEnvSet("PROTO", "$(epluse_DB)epluse.proto") drvAsynIPPortConfigure("$(INSTR)-epluse", "$(MOXA_ADDR)",0,0,0) asynSetOption("$(INSTR)-epluse", -1, "disconnectOnReadTimeout", "Y") -dbLoadRecords("$(epluse_DB)epluse.db", "PREFIX=SQ:$(INSTR), PROTO=$(PROTO), PORT=$(INSTR)-epluse") +dbLoadRecords("$(epluse_DB)epluse.db", "PREFIX=SQ:$(INSTR), PROTO=$(PROTO), PORT=$(INSTR)-epluse, UNIT_NUMBER=$(UNIT_NUMBER)")