* Method used to send a ScriptCommand as a primary program to the Secondary Client Interface.
* If called while a program is already running, the existing program will halt.
* @param command the ScriptCommand object to send.
*/
So this is expected. If you explain a little more about how you’re trying to sequence your modbus communications with the main program, perhaps we can suggest a different approach.
Ok, is there no way that you can plan the trajectory in the program running in Polyscope/URScript? The Java side of things is generally intended for handling GUI related tasks, not robot motions.
Maybe it would be good idea to use URCap with daemon written in C++ or Python. You can get values of actual TCP pose and modbus signal status in URScript and send it to daemon. Daemon can do calculations and send it back to URScipt (for example to feed servoj() function with trajectory).
Using RTDE you can exchange data between URScript and daemon (C++/Python), so you can get value using modbus_get_signal_status() in URScript, put this value in some INT register and read it from this register in daemon.