// Utilitty to change the address of an ASI device. // // Needs the asi.bas library utilities to work. // To do this load "asi.bas", using tload and then type fsave all, this // will save those utilities to flash. // =========== interactive utilities ================================= // ******************************************************************* // change address of device // ******************************************************************* function asi_change_address dim in$[:10], oldadr$[:10], newadr$[:10], k, tmp$[:10] // check to see if asi.bas is loaded by looking for "asi_find$" if fexists("asi_find$") = 0 then print "Need to load asi.bas and save to Flash, first" exitf endif print "Connect single ASI device and press a key" while key?(2)=0:wend // pause here key(2) // clear buffer // get the current device address print "wait.." in$=asi_find$(38400) if len(in$)= 0 then print "no device connected" exitf endif // get new address from user oldadr$=chr$(asc(in$,1)) print "Current device address is ";oldadr$ print "New address ? "; k=key(2) newadr$=chr$(k) print "Changing address ";oldadr$;" to ";newadr$ out$ 1 oldadr$+"U"+*13 // unlock, does not return '>' wait 100 // unlock needs this as it does not return '>' tmp$=asi_write$(oldadr$+"A"+newadr$) // change if tmp$<>">" then print "Error changing address ";tmp$ else print "Done" endif endf