Thank Paul,

Yes, i forgot to write that switch connect the pin to ground Vss

Code is very long but it do nothing of strange....



ENDWELD VAR PORTD.1
.
.
INPUT ENDWELD
.
.
PRESSED CON 0
NOTPRESSED CON 1
.
.
.
End_Weld: 'wait for end of welding cycle

if ENDWELD = NOTPRESSED then goto End_weld
.
.


I'm testing the software on the machine and seems to be
insensistive to noise but i wouldn't like to meet with gremlins!