Universal Robots Forum

USB Serial Communication

I am currently working on a project that requires the use of a rotary index that uses serial communication. Im looking into how i can get this connected to my UR5 so i can control/read positioning while running through my program. I am able able to communicate with it on my PC but im not sure how to do this with a URCap. Is there any URCaps that demonstrates this type of connection? Im new to this end of programming so please ignore my ignorance. Thanks in advance for any and all help!

Yes there is a way. First you have to find the USB, I recommend a finding a dummy file to start with. Once the USB is found you can use that path to read and write files. There is a bunch of online tutorials on how to read and write files.

Beware of a known problem where a few of us, including me, found when using a USB:

thanks for the reply. im assuming youre talking about doing that with the daemon? or what kind of tutorial are you talking about? im sorry very new to this

Yes, this would be a daemon. Create a python program that searches and finds the file on your linux system. I know there is a forum post in here that they talk about writing to a USB drive.

I would watch tutorials on youtube on how to run a python program from your linux machine. Or even how to do the stuff you want to do.

One more thing, a python program can be dangerous for your file system if you are not paying attention to what you are writing to. So do the development on a virtual machine and use dummy files like Find_this_file.txt and not This_is_myDocumentation_File.txt

I recommend doing in python because thats the easiest language to learn quickly.

You could also try using a Moxa Serial device server. This is an ethernet to serial then you could just tcp sockets for the serial instead of using usb. I have not tried this myself but I have one in my lab and its on my list. Might be easier to implement than the usb.

There is a tutorial from axis new England on you tube this is where i got the idea from. They show how to set it up. Just search youtube moxa nport ur5

@moliveira I understand how to find the usb devices but what i am unsure of if how to implement the daemon into the URCap. ive been searching through samples to try and find where this is supposed to be inserted at with no luck

Check the URCap example. on the MyDaemon swing you can file MyDaemonDaemonService.java . On that file it will show you how to set up a daemon. Follow the file path of that daemon. That should get your set up ready. The rest is just looking at error/warning messages to see why the daemon did not fire up. My first time it took a few attempts to get it running.