An issue I’ve encountered is a device that requires some configuration or initialization on IOC startup that happens to power up after the IOC has started and PINI processing has finished. The same issue arises when a device power cycles or resets itself during IOC operation — the output records in the IOC may no longer match the values in the device I use the following arrangement to handle these conditions. The technique seems to work o.k. but I wonder if there’s a better mechanism for this.
First, there’s a record that periodically reads from the device. It forward links to a ‘connection check’ record.
field(DESC, "System status")
field(DTYP, "stream")
field(INP, "@devChiller4100.proto getD(F) $(PORT) $(A)")
...
field(FLNK, "$(P)$(R)connCheck_")
}
Here’s the connection check — it watches for the device going back into the ‘no error’ state and then triggers a chain of fanout records.
###############################################################################
# Push values to chiller on reconnection.
# Monitor the status readback to detect reconnection.
record(calcout, "$(P)$(R)connCheck_") {
field(DESC, "Push on reconnect")
field(INPA, "$(P)$(R)StatusRbk.STAT NPP")
field(INPD, "0")
field(CALC, "(A=0&&D!=0));D:=A")
field(OOPT, "When Non-zero")
field(OUT, "$(P)$(R)reconnA_.PROC”)
}
And here’s the start of the records that trigger writing of values from the initialization or output records to the device – I have as many of these forward-linked as needed to push all initialization and output values to the device. It would be nice to have a fanout with more than six links!
record(fanout, "$(P)$(R)reconnA_") {
field(LNK1, "$(P)$(R)OffOn")
field(LNK2, "$(P)$(R)Setpoint")
...