# Joe's watcher code # n = laser_steer_loop1_num; # str = pv_data{n}; # if ~strcmp(str, 'Close Loop') %bad status # error_flag(n) = 1; # end # n = laser_steer_loop2_num; # str = pv_data{n}; # if ~strcmp(str, 'Close Loop') %bad status # error_flag(n) = 1; # end # (lasr):POS_FDBK # 1 is Close Loop # 0 is Open Loop # 1 if NOT CLOSE LOOP, 0 CLOSE LOOP record(calc, $(LASR):ALCLLPERRCALC) { field(CALC, "A!=1?1:0") field(INPA, "$(LASR):POS_FDBK") field(SCAN, "$(RATE) second") field(FLNK, "$(LASR):ALCLLPERR") } # put the result into a bi for state names and alarm statuses record(bi, "$(LASR):ALCLLPERR") { field(DESC, "$(DESC)") field(INP, "$(LASR):ALCLLPERRCALC.VAL") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "CLOSE") field(ONAM, "NOTCLOSE") }