K8055

Hi Guys,
I hope some one can help with some script.
I am useing VB Express. I am very new to programing.
I am going to be useing my K8055 in a landrover to control extra lights winch etc etc. Got the front end sorted and most of the script but am stuck on one bit.

I have a set of roof lights that i can turn on via a button but i also want an option to turn on with full beam. I have taken a feed from the full beam via a realy to switch one of the digital inputs

Problem i am having is it works if i have the digital input closed and then slect the tick box but when i open the input they do not turn off and also dosnt work if i tick the box and then close the digital input.

here is the script

Private Sub Roofmode_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Roofmode.CheckedChanged
If Roofmode.Checked And ReadDigitalChannel(1) = True Then SetDigitalChannel(3) Else ClearAllDigital()
End Sub

Do i need to put some form of loop in there so it keeps checking the state of the digital in?

Thanks in advance

Stuart