Others with more experience with EPICS database development may have better approaches to this, but for my applications I have:
1 - A periodically-scanned record that reads a value from the attached device: record(bi, "$(P)$(R)sysmonTrig_") { field(DESC, "Trigger system monitor readback") field(DTYP, "asynInt32") field(INP, "@asyn($(PORT), 0x0000, 0)") field(ZNAM, "Running") field(ONAM, "Rebooted") field(SCAN, "5 second") field(PINI, "YES") field(FLNK, "$(P)$(R)reconnChk_") }
2 - A calcout record that monitors the status of the periodically-scanned record and invokes an event record when the scanned record goes from bad to good: # # Push values to FPGA on reconnection. # Monitor the status of a periodically-scanned readback to detect (re)connection. # record(calcout, "$(P)$(R)reconnChk_") { field(DESC, "Push on reconnect") field(INPA, "$(P)$(R)sysmonTrig_.STAT NPP") field(INPD, “1") field(CALC, "A=0&&D!=0;D:=A") field(OOPT, "When Non-zero") field(OUT, "$(P)$(R)reconnX_.PROC") } record(event, "$(P)$(R)reconnX_") { field(DTYP, "Soft Channel") field(VAL, “RECON") }
3 - A bunch of fanout records triggered by the above event record — these fanouts trigger the output records to push their values to the device: record(fanout, "$(P)$(R)BD:rc_") { field(DESC, "Push beam dump values on (re)connect") field(SCAN, "Event") field(EVNT, "RECON") field(LNK1, "$(P)$(R)xxxxxxxx") field(LNK2, "$(P)$(R)yyyyyyyyy") field(LNK3, "$(P)$(R)zzzzzzz”) . . . }
Based on this, can i assume my links are not connected yet when the first dbpfs are called? How do i debug this kind of problem?If my links are indeed not connected and i should wait for connection, what is the EPICS recommended way of doing this?
|