# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "LIN-RF-TUNER:Cell1PosnHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "LIN-RF-TUNER:Cell1Posn CPP MS")
    field(FLNK, "LIN-RF-TUNER:Cell1PosnHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "LIN-RF-TUNER:Cell1PosnHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "LIN-RF-TUNER:Cell1PosnHeartBeatS")	
    field(INPB, "LIN-RF-TUNER:Cell1PosnHeartBeatP")				
    field(FLNK, "LIN-RF-TUNER:Cell1PosnHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "LIN-RF-TUNER:Cell1PosnHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "LIN-RF-TUNER:Cell1PosnHeartBeat")
    field(INPB, "LIN-RF-TUNER:Cell1PosnHeartBeatP")			
    field(OUT,  "LIN-RF-TUNER:Cell1PosnHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "BOO-RF-TUNER:Cell1PosnHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell1Posn CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell1PosnHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "BOO-RF-TUNER:Cell1PosnHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell1PosnHeartBeatS")	
    field(INPB, "BOO-RF-TUNER:Cell1PosnHeartBeatP")				
    field(FLNK, "BOO-RF-TUNER:Cell1PosnHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "BOO-RF-TUNER:Cell1PosnHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "BOO-RF-TUNER:Cell1PosnHeartBeat")
    field(INPB, "BOO-RF-TUNER:Cell1PosnHeartBeatP")			
    field(OUT,  "BOO-RF-TUNER:Cell1PosnHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "BOO-RF-TUNER:Cell5PosnHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell5Posn CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell5PosnHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "BOO-RF-TUNER:Cell5PosnHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell5PosnHeartBeatS")	
    field(INPB, "BOO-RF-TUNER:Cell5PosnHeartBeatP")				
    field(FLNK, "BOO-RF-TUNER:Cell5PosnHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "BOO-RF-TUNER:Cell5PosnHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "BOO-RF-TUNER:Cell5PosnHeartBeat")
    field(INPB, "BOO-RF-TUNER:Cell5PosnHeartBeatP")			
    field(OUT,  "BOO-RF-TUNER:Cell5PosnHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "LIN-RF-TUNER:Cell1MotorHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "LIN-RF-TUNER:Cell1Motor CPP MS")
    field(FLNK, "LIN-RF-TUNER:Cell1MotorHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "LIN-RF-TUNER:Cell1MotorHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "LIN-RF-TUNER:Cell1MotorHeartBeatS")	
    field(INPB, "LIN-RF-TUNER:Cell1MotorHeartBeatP")				
    field(FLNK, "LIN-RF-TUNER:Cell1MotorHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "LIN-RF-TUNER:Cell1MotorHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "LIN-RF-TUNER:Cell1MotorHeartBeat")
    field(INPB, "LIN-RF-TUNER:Cell1MotorHeartBeatP")			
    field(OUT,  "LIN-RF-TUNER:Cell1MotorHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "BOO-RF-TUNER:Cell1MotorHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell1Motor CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell1MotorHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "BOO-RF-TUNER:Cell1MotorHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell1MotorHeartBeatS")	
    field(INPB, "BOO-RF-TUNER:Cell1MotorHeartBeatP")				
    field(FLNK, "BOO-RF-TUNER:Cell1MotorHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "BOO-RF-TUNER:Cell1MotorHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "BOO-RF-TUNER:Cell1MotorHeartBeat")
    field(INPB, "BOO-RF-TUNER:Cell1MotorHeartBeatP")			
    field(OUT,  "BOO-RF-TUNER:Cell1MotorHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "BOO-RF-TUNER:Cell5MotorHeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell5Motor CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell5MotorHeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "BOO-RF-TUNER:Cell5MotorHeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell5MotorHeartBeatS")	
    field(INPB, "BOO-RF-TUNER:Cell5MotorHeartBeatP")				
    field(FLNK, "BOO-RF-TUNER:Cell5MotorHeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "BOO-RF-TUNER:Cell5MotorHeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "BOO-RF-TUNER:Cell5MotorHeartBeat")
    field(INPB, "BOO-RF-TUNER:Cell5MotorHeartBeatP")			
    field(OUT,  "BOO-RF-TUNER:Cell5MotorHeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "SPARK-BTS-BPM08:HeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "SPARK-BTS-BPM08:signals:sp.trigger_cnt CPP MS")
    field(FLNK, "SPARK-BTS-BPM08:HeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "SPARK-BTS-BPM08:HeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "SPARK-BTS-BPM08:HeartBeatS")	
    field(INPB, "SPARK-BTS-BPM08:HeartBeatP")				
    field(FLNK, "SPARK-BTS-BPM08:HeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "SPARK-BTS-BPM08:HeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "SPARK-BTS-BPM08:HeartBeat")
    field(INPB, "SPARK-BTS-BPM08:HeartBeatP")			
    field(OUT,  "SPARK-BTS-BPM08:HeartBeatCount")			
}

# watches a PV to see if is changing
# ALH will raise alarm if PV's value is static for > CountDelay seconds
# =======================================================
# Shadow the Watcher PV
record(calc,    "SPARK-BTS-BPM09:HeartBeatS") {
    field(DESC, "watcher shadow")
    field(CALC, "A")
    field(INPA, "SPARK-BTS-BPM09:signals:sp.trigger_cnt CPP MS")
    field(FLNK, "SPARK-BTS-BPM09:HeartBeatP")	
    field(SCAN, "1 second")
    field(PINI, "YES")	
}

# If the current and previous value of Watcher PV are different,
# set previous value to current; else do nothing
record(calc, "SPARK-BTS-BPM09:HeartBeatP")
{
    field(DESC, "watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "SPARK-BTS-BPM09:HeartBeatS")	
    field(INPB, "SPARK-BTS-BPM09:HeartBeatP")				
    field(FLNK, "SPARK-BTS-BPM09:HeartBeat")				
}

# if Watcher Pv has changed, 
record(calcout, "SPARK-BTS-BPM09:HeartBeat")
{
    field(DESC, "watcher counter")
    field(CALC, "(B=-1)?0:((A>=2147483647)?0:A+1)")
    field(INPA, "SPARK-BTS-BPM09:HeartBeat")
    field(INPB, "SPARK-BTS-BPM09:HeartBeatP")			
    field(OUT,  "SPARK-BTS-BPM09:HeartBeatCount")			
}

