s50_no.tmb for the SI5150 Checks normally open switch contacts and sends a string of characters when any contact is opened or closed. Format is: SSUUIIX SS=site number 01-99 UU=unit number 01-99 II=input 01-50 X=1 for activated, 0 for not is a carriage return is a line feed ------------------------------- NEW --- site number 1 A=1 --- unit number 2 B=1 -- save them 3 WRITEEE 255 --- act as power LED 4 LED=1 --- get initial status 5 S=A 6 LOOP 50 7 CHECKSW A 8 A=A+1 9 ENDLOOP --- check for any change 10 READSW 11 IF A=0 10 --- check switch loop 20 S=1 21 LOOP 50 --- check each switch 22 CHECKSW S --- skip if no change 23 IF A=B 70 24 C=1 25 IF A=0 27 26 C=0 --- send message 27 LED=0 --- send site in H 30 READEE 255 31 D=B 32 B=9 33 IF A>B 35 34 PRINT "0" 35 PRINT A --- send unit in M 40 A=D 41 B=9 42 IF A>B 44 43 PRINT "0" 44 PRINT A --- send input in S 50 A=S 51 B=9 52 IF A>B 54 53 PRINT "0" 54 PRINT S --- send switch status C 60 PRINT C 61 PRINT 13 62 PRINT 10 63 LED=1 --- next input 70 A=S 71 A=A+1 72 S=A 73 ENDLOOP --- back to main loop 80 GOTO 10