BrimStonePhoenix
Programmer
I'm using the windows forms to create a GUI for an interface with an optical encoder. The encoder reports position data whenever I send it a command to get the data. What I'm trying to do is this - when I press a button on the GUI, I want it to continually update a text field on the GUI with the current position data, so as I move the knob on the encoder, it updates the text field with the new position.
What I currently have it doing is whenever I press the button, it only gets the current point, and updates the text field once. In order to get another point, I have to push the button again.
I've tried using while/for loops within the event caller, but that just makes the application crash. I'm wondering how I can loop through the 'get data and update the text box' code on just a single button push, and then possibly stop doing it when I push a 'stop' button.
What I currently have it doing is whenever I press the button, it only gets the current point, and updates the text field once. In order to get another point, I have to push the button again.
I've tried using while/for loops within the event caller, but that just makes the application crash. I'm wondering how I can loop through the 'get data and update the text box' code on just a single button push, and then possibly stop doing it when I push a 'stop' button.