How to check if sim is paused/running/stopped (remote API)
When the simulation is paused or stopped, I don't really want my remote API client to continue running through the actual control logic. Instead, I just want it to wait until the user resumes or restarts the simulation.
What's the best way for my remote API client to become aware of the fact that the user has paused (or stopped) the simulation? When I pause or stop the simulation, I noticed that calls to simxSynchronousTrigger() fail. I also noticed that when the simulation is paused, simxGetLastCmdTime() is frozen at the previous value and when the simulation is stopped, simxGetLastCmdTime() goes to 0.
I suppose I can use the results from simxGetLastCmdTime() and simxSynchronousTrigger(), but if there is a recommended way, let me know.