09-19-2019 03:10 PM
Ooooh, I think I understand my mistake. I (crudely) added a long ms-Wait to the "Wait" state to simulate the time it would take for a motor to move to position. Obviously, in that case, it's going to take for ever to respond because it's taking forever for the state to finish.
What I should have done (or what I would do in reality) is to have a state to simply check if the move was completed (or if timeout was reached or any other condition), and if it had not yet happened, loop back and check again. That would give frequent chances for another message to get read and interrupt the cycle if need be.
Do I have that right?
09-19-2019 05:21 PM
Yes, states should be short in order to regularly check for messages. This is true for any state machine.