Using dh gripper via modbus with control box

Hi everyone,

I’m currently adapting an older Modbus RTU URCap to communicate with a DH Robotics gripper through a USB-to-RS485 adapter. I am using a UR3e.

The original URCap uses: GitHub - EbbeFuglsang/Modbus_URCap: A tool modbus RTU URCap · GitHub

instrument = modbus.Instrument('/dev/ttyTool', slaveaddress)

Since the USB-RS485 adapter is detected by the robot as /dev/ttyUSB0, I changed it to:

instrument = modbus.Instrument('/dev/ttyUSB0', slaveaddress)

The problem is that the URCap daemon no longer starts correctly. When I press Start Daemon in the Installation tab, its state briefly changes to Failed and then returns to Stopped.

Consequently, the XML-RPC call from URScript fails at:

modbus_xmlrpc.reachable()

because there is nothing listening on 127.0.0.1:40408.

The daemon is registered using:

daemonContribution.installResource(new URL("file:t_daemon/"));

and:

@Override

public URL getExecutable() {

return new URL(“file:t_daemon/modbus_xmlrpc.py”);

}

Interestingly, I have verified that modbus_xmlrpc.py itself can be executed directly on the controller and remains running, so the issue seems to occur specifically when it is started through DaemonContribution.start().

The URCap is relatively old and was originally built using URCap API 1.8.0.

Has anyone experienced a similar issue with an older Python daemon URCap on newer PolyScope versions? Is there anything that needs to be changed in the DaemonService / DaemonContribution implementation for newer systems?

Any suggestions on where I should look next would be greatly appreciated.

Thanks!

I don’t know if this fits your diagnosis at all, I just remember beating my head against a wall for ages with a Daemon problem, and the actual problem ended up being that the file’s file endings got changed from CRLF to just LF. As soon as I changed the file endings back, the Daemon connected properly.