My intent is to push output record values to an attached FPGA when the FPGA powers up or when communication to the FPGA is restored. To do this I have a periodically-scanned record that monitors the FPGA power-up status and a CALC record that attempts to detect communication restoration or FPGA power-up:
#
# Value of this record is the FPGA power-up status.
#
record(bi, "$(P)$(R)FPGA:Powerup") {
field(DESC, "Trigger sysmon read. FPGA power-up?")
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT) 0x0000 0)")
field(SCAN, "2 second")
field(ZNAM, "Not restarted")
field(ONAM, "Restarted")
field(FLNK, "$(P)$(R)IOC:reconChk_")
}
#
# Monitor the status of the FPGA power-up status record (B) to detect
# reconnection and monitor the value (A) to detect FPGA power up.
# Push output record values to FPGA when required.
#
record(calcout, "$(P)$(R)IOC:reconChk_") {
field(DESC, "Trigger push on reconnect or power up")
field(INPA, "$(P)$(R)FPGA:Powerup NPP NMS")
field(INPB, "$(P)$(R)FPGA:Powerup.STAT NPP NMS")
field(INPC, "0")
field(CALC, "B=0&&((C!=0)||A);C:=B")
field(OOPT, "When Non-zero")
field(TPRO, 1)
field(OUT, "$(P)$(R)IOC:recon_.PROC")
}
record(fanout, "$(P)$(R)IOC:reconA_") {
field(PINI, "YES”)
. . . Here’s where I have the LNKx records that trigger output record processing . . .
field(FLNK, “$(P)$(R)IOC:clrPwrup_")
}
record(longout, "$(P)$(R)IOC:clrPwrup_") {
field(DESC, "Clear FPGA power-up status")
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT) 0x1000 0)")
}
But this doesn’t seem to work. When communication is broken and restored (the ‘Dalesio Test’) the calcout record is in a weird state. The problem is illustrated by monitoring a few things:
camonitor TEST:IOC:reconChk_ TEST:IOC:reconChk_.A TEST:IOC:reconChk_.B TEST:FPGA:Powerup
TEST:IOC:reconChk_ 2021-07-03 14:57:04.957026 0
TEST:IOC:reconChk_.A 2021-07-03 14:57:04.957026 0
TEST:IOC:reconChk_.B 2021-07-03 14:57:04.957026 0
TEST:FPGA:Powerup 2021-07-03 14:57:04.957004 Not restarted
<<<< Here’s where I unplugged the network cable >>>>>
TEST:FPGA:Powerup 2021-07-03 14:57:11.573206 Not restarted READ INVALID
TEST:IOC:reconChk_.B 2021-07-03 14:57:11.573230 1
<<<<< Here’s where I reconnected the network cable >>>>>
TEST:FPGA:Powerup 2021-07-03 14:57:24.957220 Not restarted
TEST:IOC:reconChk_ 2021-07-03 14:57:24.957249 1 LINK INVALID <<<<< Why is this happening? Link has NMS
TEST:IOC:reconChk_.A 2021-07-03 14:57:24.957249 0 LINK INVALID
TEST:IOC:reconChk_.B 2021-07-03 14:57:24.957249 0 LINK INVALID
TEST:IOC:reconChk_ 2021-07-03 14:57:26.957653 0
TEST:IOC:reconChk_.A 2021-07-03 14:57:26.957653 0
TEST:IOC:reconChk_.B 2021-07-03 14:57:26.957653 0
So even though the CALC record value is non-zero, the value isn’t pushed to the OUT link and the fanout and assorted downstream records don’t process.
I tried with OOPT=“Transition To Zero” and got the same result.
Why is the CALC record going into LINK INVALID state? Do I misunderstand what NMS is supposed to do?