# # A set of records to check that a hearbeat is # changing is value to 0 and 1. # If for some time interval it does not do that # the record $(SYS):hb_check is set to 0. # Otherwise its value is 1. # # # Check for 0 value in heartbeat, if not detected increment by 1 grecord(calc,"$(PREF)$(SYS):hb_0s") { field(DESC,"Counter of 0 states" ) field(SCAN,".1 second") field(CALC,"(a&1)=0?0:b+1") field(INPA,"$(HB_CHANNEL) NPP MS") field(INPB,"$(PREF)$(SYS):hb_0s NPP NMS") } # Check for 1 value in heartbeat, if not detected increment by 1 grecord(calc,"$(PREF)$(SYS):hb_1s") { field(DESC,"Counter of 1 states" ) field(SCAN,".1 second") field(CALC,"(a&1)=1?0:b+1") field(INPA,"$(HB_CHANNEL) NPP MS") field(INPB,"$(PREF)$(SYS):hb_1s NPP NMS") } # Calculates if hartbeat is present or not # 1 - heartbeat is present, 0 - no heartbeat in $(SYS) grecord(calc,"$(PREF)$(SYS):hb_calc") { field(DESC,"Check for $(SYS) heartbeat") field(SCAN,".2 second") field(CALC,"a<(g/2.)&b<(g/2.)?1:0") field(FLNK,"$(PREF)$(SYS):hb_check PP NMS") field(INPA,"$(PREF)$(SYS):hb_0s NPP MS") field(INPB,"$(PREF)$(SYS):hb_1s NPP MS") field(INPG,"$(PREF)$(SYS):dead_hb_tolr CPP NMS") field(HIHI, "1.0") field(HIGH, "1.0") field(LOW, "0.1") field(LOLO, "0.1") field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "MAJOR") field(LLSV, "MAJOR") } grecord(bi, "$(PREF)$(SYS):hb_check") { field(DESC, "$(SYS) heartbeat status") field(SCAN, "Passive") field(PINI, "1" ) field(INP , "$(PREF)$(SYS):hb_calc NPP MS") field(ZNAM, "Dead" ) field(ONAM, "Live" ) field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } # This record indicates how many seconds to wait before # determining that the heartbeat is missing. grecord(ai,"$(PREF)$(SYS):dead_hb_tolr") { field(DESC,"Time limit for missing heartbeats") field(SCAN,"Passive") field(PINI, "1") field(VAL, "$(TOLER)") field(DTYP,"Soft Channel") }