URCaps with third party DLL/.so

Good morning,
I would like to know if it’s possible to add a third party library to an URCaps. I would like to create our .dll (if we implements them in Windows SO) or .so (if we work on Linux system) and use it in our urcaps. I found some topics where it’s described how to include external jar, so I would like to know if it’s possible to add binary/library written in different languages (for example in C++).

Thank you

Hello,

depending on what you are trying to achieve with your .so (UR is running a Linux system no .dlls here) there are possibilities.

  • If you want to do something in your .so that will only need to be available from Java then you need to look at JNI. This will probably require an adapter to be written in order to work, here JNA might be helpful.
  • If you want to do something with the .so from the running robot program you will need a way for the URScript to interact with the .so. For this you will need a running daemon that acts as a bridge from URScript to the .so code. For this take a look at the MyDaemon example from the UR SDK.

Hope this helps point you in the right direction.

Thank you so much for your reply.
I need to create some method that could be invoked in the java code while the user interact with the URCap GUI.
I never used the solution you suggest (JNI and JNA) but I’ll try to use them. Do you by any chance already use them so that you could give me more tips on how to correctly implement a solution exploiting JNI and JNA?

Thank you again

I have so far only implemented the daemon solution myself. I only know about JNI from my research on the topic. But as the technology is part of Java the documentation from Oracle should be fairly good. And there are probably some small examples on the web to look at.

Sorry I cannot be of more help going that route.

Thank you very much for your support. I’ll try the solutions you suggested.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.