You don't need to have the niSwitch_Connect() function in a loop if you do not want the switch status to change. One call to the Connect() function will connect the two channels and leave them in that state until you eplicitly make a call using niSwitch_Disconnect() to change their state again.