bl4s200 digital input

I am using bl4s200. I try to use the contact from a relay to bring digital input to my bl4s200. The digital input is in J1, and I set JP1 to 5-6 (pull down to 0V). I am able to engage relay and reading is good. but when I degage relay, my program is frozen. Anybody know what is going? Even I use 5VDC, I have the same problem. the connection is followed:

DIO —> one terminal of contact ---->another terminal of contact –> +12VDC.

Where is it freezing in your program? Can you attach the code to this question?

What version of Dynamic C are you using?