@Charles

Thanks very much for both replies and apologies for not replying tot he first one, I think for some reason I got sidetracked after reading it (it suddenly got some thoughts going) and I forgot to reply :-(

Regarding the latest posting you have made... what exactly do you have in mind with this code ?
Code:
IF  InputPin = 0 THEN
        Counter = 0
   ENDIF

   IF Counter > 2 then goto PowerGone   
   IF Counter < 254 THEN Counter = Counter + 1
   Pause 5
   Goto Topp
Are you suggesting I have a zero-cross detector on 'InputPin' ?

And Counter > 2 ?
What are we counting ?


Kind regards
Dennis