I control the motion app via the datalayer interface for C++. When I call a command, like "move absolut" I need to wait until it is done to continue with a movement, that's why I am using the command-ID and the commando-state to check if the commando is done. I check this by the state ACTIVE. So I wait in a thread as long as the command state is ACITVE, when it is not ACTIVE anymore it is DONE or ABORTED. The thing is that the command state can before be in PREPARED, CREATED or INBUFFER, but this can be solved by also waiting in the thread for these states too. The problem is that when you ask for a random/unused command-ID the state is also INBUFFER. So it can not be detacted, when a wrong command-ID is used and the program/thread is locked forever, because the state will not switch from INBUFFER.ย
One way to solve this would be to not buffer any command, so INBUFFER can be a error state. But the C++ interface doesn't offer a parameter to decide whether a command is buffered or not as far as I know. Is there a way to change the default for commands to not put them into the buffer?
Is it okay not to use a timeout for waiting for a command state and trust that a command state will always change to DONE or ABORTED somewhen?