Sychronization over serial port
-
I am using a Duet 3 Mini 5+ currently with 3.5.0-rc.3 to control my measurement instrument prototype. I am sending commands over the serial port from Octave. It works fine to just send a lot of commands including M400 to wait for motors etc. I have not read anything back from the card. However, now I need to wait for the card to finish all commands sent, then change something external, and send more commands. What is the best way to do this synchronization? Maybe use the M111 command in the config.g to set it to give a response to every command, and have the Octave send a special code, which has a response that Octave can read and recognize?
-
@torstha if you track the OK responses from each command then you can use the M400 command to wait for all movement to stop. You won't get an OK response from the M400 command until motion has stopped.
Alternatively, use the M409 command to read state.status in a loop and wait for it to become "idle".