LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Statemachines and Polling of Inputs for Motion Control

Solved!
Go to solution

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? 

0 Kudos
Message 11 of 12
(241 Views)

Yes, states should be short in order to regularly check for messages.  This is true for any state machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 12
(229 Views)