- GOTO SCREEN begin *>SCREEN begin - PUT TEXT AT (8,3): "ETI LINK INITIALIZATION" - PUT TEXT AT (5,5): "ENTER THE NUMBER OF SLAVES:" - POWER RESUME ON - LABEL redo - GET NUMBER maxslvs% AT (33,5) USING "##" DEFAULT maxslvs% if maxslvs%>32 or maxslvs%<1 then goto redo call etiinit(0) call etiwr(0,1,0):n%=1 call etipoll(n%,stat%):if stat%<>0 then goto %%-1 if n%<=maxslvs% then goto %%-1 - PUT TEXT AT (6,7): "ALL SLAVES HAVE RESPONDED" - GOTO SCREEN main *>SCREEN main - SOFTKEY (1) "SEND" GOTO SCREEN sendscr - PUT TEXT AT (1,1): "SLAVE DATA:" - LABEL main1 - SOFTKEY CHECK n% = 1 call etipoll(n%,stat%):if stat%<>0 then gosub slavesrv if n% <= maxslvs% then goto %%-1 - GOTO LABEL main1 - LABEL slavesrv if stat% = -1 then goto linkerr s%=n%-1 : x%=1+fix((s%-1)/6)*12 : y%=2+((s%-1) mod 6) call etird(s%,3,sdat%) call etiwr(s%,1,0) pos x%,y%:print"#";s%;:print using "-######";sdat%; - RETURN *>SCREEN sendscr - PUT TEXT AT (13,3): "ENTER SLAVE NUMBER:" - LABEL senderr - GET NUMBER snum% AT (33,3) USING "##" DEFAULT snum% if snum%<1 or snum%>maxslvs% then goto senderr - PUT TEXT AT (4,4): "ENTER DATA TO SEND TO SLAVE:" - GET NUMBER sdata& AT (13,5) USING "-############" DEFAULT sdata call etiwr(snum%,2,sdata&) - GOTO SCREEN main *>SCREEN linkerr - PUT TEXT AT (7,3): "SLAVE FAILED TO RESPOND" - PUT NUMBER s% AT (13,3) USING "##" - DELAY 1500 return main - END OF PSEUDOCODE