implement support for setting unit number

This commit is contained in:
2026-05-18 10:16:51 +02:00
parent 7025bda304
commit 833ae7b3b4
3 changed files with 11 additions and 3 deletions
+9
View File
@@ -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")
+1 -1
View File
@@ -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%<sum8>";
in "%(\$1:UNIT-NUMBER)2r" 0x67 0x0A 0x06 0x00 "%(A)#R%(B)#R%<sum8>";
}
+1 -2
View File
@@ -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)")