Thank You, I added the bolded while loop after finishing with the connection and it seems to be working fine now.
Code:
PRINT #4 "<MBTCPCONNECT "+I$+":502>"
Call Wait4conn //WAIT FOR CONNECTION
S = STATUS(3) //S=1 = CONNECTED, S=0 = NOT CONNECTED
IF(S = 1) THEN
setlcd 2,1, "READING REMOTE DEV..."
READMB2 4,Q,1000+(O-1),DM[N],VAL(M$)
IF STATUS(2) = 0 THEN
setlcd 2,1, "BAD READ ADDRESS..."
save_eep$ "ERROR READING "+STR$(1000+(O-1)) +":" + STR$(VAL(M$))+" AT " + I$+"."+STR$(Q), 40+L
ELSE
setlcd 2,1, "GOOD READ ADDRESS..."
save_eep$ "GOOD READING "+STR$(1000+(O-1)) +":" + STR$(VAL(M$))+" AT " + I$+"."+STR$(Q), 40+L
ENDIF
REFRESH //REFRESH IO'S
ELSE
setlcd 2,1, "UNABLE TO CONN REM..."
save_eep$ "ERROR: "+INPUT$(4)+", UNABLE TO CONNECT "+I$+"."+STR$(Q), 40+L
ENDIF
PRINT #4 "</>"
while status(3) <> 0
//do nothing...
endwhile
Function Wait4Conn:
I = 1
while STATUS(3) <> 1 OR I > 1000
I = I + 1
ENDWHILE
S = STATUS(3)
I = 1
RETURN
Thanks,
Ed