Ok i found some time at work to get a bit further and start to get my head around loops.
I have came up with this
Private Sub Roofmode_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Roofmode.CheckedChanged
Do
If Roofmode.Checked = True And ReadDigitalChannel(1) = True Then SetDigitalChannel(3) Else ClearDigitalChannel(3)
If Roofmode.Checked = True And ReadDigitalChannel(1) = True Then SetDigitalChannel(4) Else ClearDigitalChannel(4)
If Roofmode.Checked = False Or ReadDigitalChannel(1) = False Then ClearDigitalChannel(3)
If Roofmode.Checked = False Or ReadDigitalChannel(1) = False Then ClearDigitalChannel(4)
Loop
End Sub
Problem is that is crashs the program if i try to uncheck the roofmode.
I did try adding a do until readdigitalchannel (1) = false OR Roofmode = False
but that had the same problem