RTDE Java Implementation Support

Hello,

Still new to the development of a URCap project and find myself stuck on a function I want to implement. In short, I’d like to create a toolbar application that has a button and starts the loaded program on the UR by setting an input register on (which is linked to START program).

With that context, I’ve found the only way to accomplish this is to use RTDE, which has been discussed on this forum. Digging deeper, I found that a user on this forum developed a Java implementation of the classes (Here: GitHub - t-fujiki/com.takaaki.urcap.eipmonitor at 3cb07e7a95fbdca102de398fbe93961f2311c6c1)

With this implementation, I cant seem to follow along on how to implement this in my program. I’ve loaded the RTDEClient.java class (which is an abstraction of a Thread), and then loaded the RTDEClientOfIntegerRegister (Which is an abstraction of RTDEClient). Since both of these are abstractions, I created another class that extends RTDEClientOfIntegerRegister so that I could instantiate it in my Toolbar application.

This is where things get fuzzy - I see there’s a method in the class structure to “Run()” the thread and create the connection. However, from there, I’m not clear how I can access the integer registers it’s receiving and furthermore how to set an integer register to a value. Could anyone help me with this? I believe there’s a fundamental gap I’m not briding but cant seem to see it.

You’re not alone. Any time I get to a problem and the solution is “use the RTDE” I just sigh and give up. I don’t have the time currently to figure out how to make it work. I’ve gone down exactly the same path you have. For what it’s worth, you can write the registers using UR script, which you can send via java by using the primary/secondary interface.

This post has the relevant information and the link to the git repo. It’s probably not the most ideal, as the sockets can lag the robot if went multiple times rapidly, but it’s the only way I’ve found to do certain actions. If you ever figure out how to get that RTDE to work in Java, let me know.

1 Like

Thanks for the response! Yea, I’ve been digging through the forums and other resources, but cant seem to find a true “example” of how to implement it in a URCap application. Thanks for a backup solution and hopefully I can get a solution that I can share with everyone

edit: I just followed the link and realized this is actually an implementation I’ve already tried but pretty sure doesn’t allow to manipulate input register values. Since the input registers are the only registers you can link to a robot function (i.e START, PAUSE, STOP program), I can’t seem to make this work for me. @Eric.Fieldman have you been able to use this to manipulate input register values?

I’ve not personally tried to write input values with it, no. That sounds reasonable though that you wouldn’t be able to. I sometimes forget that all the systems I work with have a small PLC on them, so I’ve probably just done stuff like map an output to an input, and then write to the output lol. There is also a way to write to the PHYSCIAL I/O using Java. There’s some IOHelper class floating around too I believe. Then you can just do something like digitalInput1 = getDigitalIO(1), digitalInput1.setSignal(true). I hate doing this because eating the limited physical IO for a software control is a waste, but that’s the only way to easily do it in Java until I see some real clear-cut way of implementing the RTDE

1 Like

For RTDE implementation in Java. This sample might be helpful.