# AMPLITUDE is an analog IO tag
# OUTPHI is the high output limit for the IO TAG
# if AMPLITUDE is equal to high output limit, add tag1 to tag2
if {[GETVAL AMPLITUDE] == [GETVAL AMPLITUDE.OUTPHI]} then {
SETVAL tag2=[expr [GETVAL tag1]+[GETVAL tag2] ]
}