01-08-2013 10:53 PM
Hi I am fairly new at programming using an encoder and need some assistance. I wanted to program an arm with an encoder to go to a position and HOLD THERE on the press of a button until ANOTHER BUTTON is pressed. (so like a loop keeps running holding the arm in place, like if the arm is lower than it should be the code moves it back up and if its high moves it lower... until another button is clicked)
01-21-2013 04:33 PM
It sounds like the type of program you're looking to design would work well with a state machine architecture. You can find a lot of information on the state machine architecture in this tutorial on ni.com http://www.ni.com/white-paper/3024/en . You could have a state that extends the arm, one that retracts it, and one that holds the arm in place. The current state of the machine could be controlled by a front panel control, like the buttons you were discussing.
I hope that helps.