Thanks mackrackit, IF (ADVAL > 1) AND (ADVAL < 53) THEN ... this code is working..
Since we using ADCIN for switches, should be able to TOGGLE the ports.. I have tried with WHILE..WEND also.. no luck.. Could you pls ..Thanks again.