Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 833ae7b3b4 | |||
| 7025bda304 | |||
| 3d40f43540 | |||
| 9f40a89bae | |||
| 0e66852b2f |
+30
-3
@@ -1,20 +1,47 @@
|
||||
record(bo, "$(PREFIX):FETCH")
|
||||
record(calcout, "$(PREFIX):FETCH")
|
||||
{
|
||||
field(DTYP, "stream")
|
||||
field(DESC, "Initialization parameters")
|
||||
field(OUT,"@$(PROTO) fetch_rht($(PREFIX)) $(PORT) 0")
|
||||
field(SCAN,"1 second")
|
||||
field(CALC, "0")
|
||||
field(OUT, "@$(PROTO) fetch_rht($(PREFIX)) $(PORT) 0")
|
||||
field(SCAN, "1 second")
|
||||
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")
|
||||
}
|
||||
|
||||
record(ai, "$(PREFIX):TEMP")
|
||||
{
|
||||
field(DESC, "Temperature")
|
||||
field(INP, "$(PREFIX):FETCH.A NPP MS")
|
||||
field(EGU, "degC")
|
||||
}
|
||||
|
||||
record(ai, "$(PREFIX):RELHUM")
|
||||
{
|
||||
field(DESC, "Relative Humidity")
|
||||
field(INP, "$(PREFIX):FETCH.B NPP MS")
|
||||
field(EGU, "%RH")
|
||||
}
|
||||
|
||||
record(asyn,"$(PREFIX):ASYN")
|
||||
{
|
||||
field(DTYP,"asynRecordDevice")
|
||||
field(PORT,"$(PORT)")
|
||||
field(ADDR,"-1")
|
||||
field(TMOD, "NoI/O")
|
||||
field(TMOT, -1.0)
|
||||
}
|
||||
|
||||
|
||||
+14
-6
@@ -3,6 +3,11 @@
|
||||
|
||||
Terminator = '';
|
||||
ReplyTimeout = 3000;
|
||||
LockTimeout = 5000;
|
||||
ReadTimeout = 2000;
|
||||
MaxInput = 15;
|
||||
# Remove if we can fix the occasional null byte being sent
|
||||
#ExtraInput = Ignore;
|
||||
|
||||
# unsolicited weight message
|
||||
fetch_rht {
|
||||
@@ -10,17 +15,20 @@ fetch_rht {
|
||||
# 3rd byte is command, fetch rht values
|
||||
# 4th byte length of message, 2 bytes
|
||||
# 5th and 6th byte, data. For this case it is 1
|
||||
|
||||
|
||||
out 0x00 0x00 0x67 0x02 0x00 0x01 0x6a;
|
||||
# First 2 bytes is address
|
||||
# 0xca8b is the unit at neutra
|
||||
# command
|
||||
# length
|
||||
# ack
|
||||
# 0x67 command
|
||||
# 0x0A length
|
||||
# 0x06 ack
|
||||
# 0x00, unknown what this is
|
||||
# 2 ieee_754 floats.
|
||||
# Read exactly one char, but drop it. crc8
|
||||
|
||||
# The device sometimes adds an extra 0x00 at the end...weird
|
||||
# this is handled with ?c command
|
||||
in 0xca 0x8b 0x67 0x0A 0x06 0x00 "%(\$1:TEMP)#R%(\$1:RELHUM)#R%*c%*?1c";
|
||||
# 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 "%(\$1:UNIT-NUMBER)2r" 0x67 0x0A 0x06 0x00 "%(A)#R%(B)#R%<sum8>";
|
||||
}
|
||||
|
||||
+6
-3
@@ -1,4 +1,3 @@
|
||||
require asyn
|
||||
require stream
|
||||
# Parameterized snippet to load support for the eplue EE31 environmental sensor used at ICON and Neutra.
|
||||
|
||||
@@ -7,6 +6,10 @@ require stream
|
||||
|
||||
epicsEnvSet("PROTO", "$(epluse_DB)epluse.proto")
|
||||
|
||||
drvAsynIPPortConfigure("$(INSTR)-sps", "$(MOXA_ADDR)",0,0,0)
|
||||
### We have autoconnect and disconnectOnReadTimeout enabled, so that it can come and go
|
||||
## without generating too much noise. We detect connected state via asyn record .CNCT
|
||||
# drvAsynIPPortConfigure(portName, hostInfo, priority, noAutoConnect, noProcessEos)
|
||||
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)-sps")
|
||||
dbLoadRecords("$(epluse_DB)epluse.db", "PREFIX=SQ:$(INSTR), PROTO=$(PROTO), PORT=$(INSTR)-epluse, UNIT_NUMBER=$(UNIT_NUMBER)")
|
||||
|
||||
Reference in New Issue
Block a user