Digital inputs, such as a limit switch, can be used to control movement of your servos. To do this, wire a limit switch to a digital input on your cRIO, then use the digital input as control for a case structure. Case structures allow your program to execute code depending upon certain conditions. In this snippet, the case structure will move your servo motors when the switches are pressed. The example code below shows two case structures, the first will move the servo motor forward to 180 degrees when one limit switch is pressed, the second case structure will move the servo backward to 0 degrees when another limit switch is pressed.
Looking for more information on sensor programing? Check out these online tutorials about the basics of sensor programming and sensor fusion.