Hello forum users,
I’ve encountered a rather unique problem in the development of the URCap im currently developing. I need to be able to send some commands over a TCP/IP to a server to stop some external equipment when the program is paused in order to maintain safety, which I can do either in java or URScript. I am currently using a java thread to monitor the
programState from the dashboard server to detect pauses in the program.
The problem arises as a result of the fact that the server I am sending to can only have 1 connected client at any given time and making changes to this server is out of my control. At the time the program is paused, the URScript client is connected, since other commands are sent during the program. This means that i can’t connect the java client to send the required signals at program pause, and I can’t send URScript from the secondary client to either disconnect and allow java to communicate, or send the required commands directly from URSCript, since the secondary client can’t seem to write script when the program is paused.
My best current workaround is to have the dashboard server stop the program when pause is pressed. Since a program is then stopped and no longer running, i can send script through the secondary client. This unfortunately has the effect of the pause button just becoming another stop button, which is certainly less than ideal functinoality and has other safety implications.
Has anyone else encountered a similar problem and if so, how was it overcome? All suggestions welcome,
I encountered a similar problem using a Modbus device (but TCP/IP should be similar), initially this problem was solved by having the java client be in constant control of the external equipment with the URController connecting and passing commands to the Java client which relays it to the external device.
Eventually we moved all this control over to a daemon which communicates via XML-RPC and accepts commands from both the Java interface of Polyscope and URControl via URScript, checks it and passes it on to the external device.
Hope this helps you along,
Hi Gunther, thanks for the suggestion. It certainly seems like XML-RPC, having also brainstormed this with a colleague, is going to be the way to go to allow unified control from either the implemented java client or, as you suggest, from a daemon.