# 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:Cell1PosnShadow") {
    field(DESC, "LIN-RF-TUNER:Cell1Posn watcher pv")
    field(CALC, "A")
    field(INPA, "LIN-RF-TUNER:Cell1Posn.VAL CPP MS")
    field(FLNK, "LIN-RF-TUNER:Cell1PosnShadowP")	
	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:Cell1PosnShadowP")
{
    field(DESC, "LIN-RF-TUNER:Cell1Posn watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "LIN-RF-TUNER:Cell1PosnShadow")	
    field(INPB, "LIN-RF-TUNER:Cell1PosnShadowP")				
    field(FLNK, "LIN-RF-TUNER:Cell1PosnWatcher")				
}

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

# 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:Cell1PosnShadow") {
    field(DESC, "BOO-RF-TUNER:Cell1Posn watcher pv")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell1Posn.VAL CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell1PosnShadowP")	
	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:Cell1PosnShadowP")
{
    field(DESC, "BOO-RF-TUNER:Cell1Posn watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell1PosnShadow")	
    field(INPB, "BOO-RF-TUNER:Cell1PosnShadowP")				
    field(FLNK, "BOO-RF-TUNER:Cell1PosnWatcher")				
}

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

# 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:Cell5PosnShadow") {
    field(DESC, "BOO-RF-TUNER:Cell5Posn watcher pv")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell5Posn.VAL CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell5PosnShadowP")	
	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:Cell5PosnShadowP")
{
    field(DESC, "BOO-RF-TUNER:Cell5Posn watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell5PosnShadow")	
    field(INPB, "BOO-RF-TUNER:Cell5PosnShadowP")				
    field(FLNK, "BOO-RF-TUNER:Cell5PosnWatcher")				
}

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

# 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:Cell1MotorShadow") {
    field(DESC, "LIN-RF-TUNER:Cell1Motor watcher pv")
    field(CALC, "A")
    field(INPA, "LIN-RF-TUNER:Cell1Motor.VAL CPP MS")
    field(FLNK, "LIN-RF-TUNER:Cell1MotorShadowP")	
	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:Cell1MotorShadowP")
{
    field(DESC, "LIN-RF-TUNER:Cell1Motor watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "LIN-RF-TUNER:Cell1MotorShadow")	
    field(INPB, "LIN-RF-TUNER:Cell1MotorShadowP")				
    field(FLNK, "LIN-RF-TUNER:Cell1MotorWatcher")				
}

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

# 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:Cell1MotorShadow") {
    field(DESC, "BOO-RF-TUNER:Cell1Motor watcher pv")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell1Motor.VAL CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell1MotorShadowP")	
	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:Cell1MotorShadowP")
{
    field(DESC, "BOO-RF-TUNER:Cell1Motor watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell1MotorShadow")	
    field(INPB, "BOO-RF-TUNER:Cell1MotorShadowP")				
    field(FLNK, "BOO-RF-TUNER:Cell1MotorWatcher")				
}

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

# 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:Cell5MotorShadow") {
    field(DESC, "BOO-RF-TUNER:Cell5Motor watcher pv")
    field(CALC, "A")
    field(INPA, "BOO-RF-TUNER:Cell5Motor.VAL CPP MS")
    field(FLNK, "BOO-RF-TUNER:Cell5MotorShadowP")	
	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:Cell5MotorShadowP")
{
    field(DESC, "BOO-RF-TUNER:Cell5Motor watcher counter")
    field(CALC, "(A!=B)?A:-1")
    field(INPA, "BOO-RF-TUNER:Cell5MotorShadow")	
    field(INPB, "BOO-RF-TUNER:Cell5MotorShadowP")				
    field(FLNK, "BOO-RF-TUNER:Cell5MotorWatcher")				
}

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

