Communication between COGNEX and UR


I’m currently working on a similar project
I have an In-Sight 2800 Vision Sensor (COGNEX) and a UR10 (Universal Robots), and I want to inspect a few points of a part. To do this I need to trigger the camera in each point.

I’m using Ethernet/IP to communicate between both devices.
I will attached some images, so you can see what I have already done.
I opened the connection, and when I run the program It’s TRUE, but I didn’t managed to trigger the camera.

I also tried to use Telnet over the camera, and use the native commands. And I tried to sent them with my pc ant it triggers the camera. When I try to communicate with the robot it doesn’t work. I used socket commands in the URscript.

ISConnection:=socket_open("", 44818, "IS2800")
trigger:=socket_send_string("SW8", "IS2800")


The In-Sight 2800 don’t use In-Sight Explorer, it uses In-Sight Vision Suite.
I can send you a simples JOB in this Software.


JOB_VD.jobx (4.8 MB)

I forgot to mention you! @Mathijs

Thank you for adding the additional info! What triggers me is that you say it works when using your pc.

Can you run your program and then make a screenshot of the log tab?

My suspicion is that the log will probably look like this (make sure the info icon is toggled on):

Can you either confirm you get this in your log or send the screenshot of the teach pendant if it is different?


It’s already working!

Thanks for the help

What was the problem in the end?

The camera and the robot work both as a Slave on a TCP/IP. So we needed to use a Telnet server, making the camera the server of the communication.
This is because the camera already have this option embedded.

Now the port used is 23, and to establish the connection a Loop cycle is made, to ensure the connection is “True”. To communicate with the camera, her native commands were used.

The next problem I faced, was sending strings to the camera for example, the trigger command.
As it turns out, telnet requires not only a newline \n, but also a carriage return \r right before hand. Being so, every time we want to send a string "socket_send_string(“SW8”), we need to send two bites:
socket_send_byte(13) and socket_send_byte(10). This is the only way to allow the camera to read the strings.

After figuring out all this, it ways straight forward to program de robot!

Thanks for the help!

Ah yes of course. And the return value of socket_send_string is probably True if the message was sent so that made it confusing.

Just for reference if other people look this up, any command sent to a Cognex camera needs to include a newline and carriage return (\r\n):

Using UR Script it would look like this

### Send command ###
socket_send_string("command" , socket_name)
socket_send_byte([13,10], socket_name)