# Timeout Error with Vision System

**URL:** <https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445>\
**Category:** Robot Communication\
**Created:** [January 27, 2023, 11:28am UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445 "2023-01-27T11:28:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mouzzamhusain](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mouzzamhusain](https://forum.universal-robots.com/u/mouzzamhusain)\
**Post date:** [January 27, 2023, 11:28am UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/1 "2023-01-27T11:28:55Z")

</div>

Hi All,

I am trying to establish communication with Keyence Vision system(CV-X series) using UR5e over TCP/IP.  
I am able to read the value from vision controller using:  
socket\_read\_ascii\_float().

However, when I am trying to send any commands over socket, for instance,

{Command to change mode form run to set up is: S0}

socket\_send\_string(“S0”,“CAM1”)

when I am sending this script and checking on Ethernet monitor of Keyence, it is receiving the command S0 but replying with ER,S0,91 which essentially is Error, S0, Timeout error.

Does anyone have any idea how I can fix this because in the script syntax to send, I cannot add timeout??

I really appreciate any suggestions.  
Thanks in advance,

Mouzzam

---

<div class="post-metadata">

**Author:** ![miwa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/miwa/32/2986_2.png) [@miwa](https://forum.universal-robots.com/u/miwa)\
**Post date:** [January 27, 2023, 2:01pm UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/2 "2023-01-27T14:01:43Z")

</div>

Hello,

We have a support article regarding the use of Keyence vision systems:

[https://www.universal-robots.com/articles/ur/application-installation/vision-guided-robotics-example-using-keyence/](https://www.universal-robots.com/articles/ur/application-installation/vision-guided-robotics-example-using-keyence/)

I believe your send string command needs to get followed by a socket\_send\_byte(13) then socket\_send\_byte(10) to register a new line for a future string to come in. The order could be 10 then 13 fyi, I’m going of of memory and it’s been a bit since I’ve helped with this integration.

---

<div class="post-metadata">

**Author:** ![mouzzamhusain](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mouzzamhusain](https://forum.universal-robots.com/u/mouzzamhusain)\
**Post date:** [January 30, 2023, 10:58am UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/3 "2023-01-30T10:58:51Z")

</div>

Thanks for the suggestion @miwa .  
However, I am sending the byte 13 and 10 as well after the main string. But still on the command window, I see the same error.  
Can we send a timeout with the send string or any other way it can be achieved?

---

<div class="post-metadata">

**Author:** ![miwa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/miwa/32/2986_2.png) [@miwa](https://forum.universal-robots.com/u/miwa)\
**Post date:** [January 30, 2023, 11:13am UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/4 "2023-01-30T11:13:46Z")

</div>

Post a screenshot of your robot code, and that may help show the issue. If you don’t want your code on the forum, I recommend opening a service case through myUR or reaching out to your distributor.

---

<div class="post-metadata">

**Author:** ![mouzzamhusain](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mouzzamhusain](https://forum.universal-robots.com/u/mouzzamhusain)\
**Post date:** [January 30, 2023, 1:49pm UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/5 "2023-01-30T13:49:44Z")

</div>

This is what I am coding in the pendent.

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/b/ba8be1a98c96a6e89a97869a240e558a54c5de1e.png)

var\_1 returns True.

Below is the screenshot from Keyence command screen.

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/4/48ccdb3c7a6d9be3c1267092f936cf07202b901e.png)

---

<div class="post-metadata">

**Author:** ![miwa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/miwa/32/2986_2.png) [@miwa](https://forum.universal-robots.com/u/miwa)\
**Post date:** [January 30, 2023, 4:12pm UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/6 "2023-01-30T16:12:10Z")

</div>

I believe the Wait 2.0 should go after the socket\_send\_byte commands. This way, you send the string and new line command consecutively. The connection may be timing out because it is not getting the new line bytes fast enough.

Additionally, when you open your socket in the before start, I recommend assigning the socket\_open to a variable, and then looping while that variable is false. This will ensure the socket is actually open before the program continues so you don’t accidentally send commands to an unopened socket. See below:

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/a0683e4ac4e0f235ffe7bca4baf2d06394a8d6d6.png)

---

<div class="post-metadata">

**Author:** ![mouzzamhusain](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mouzzamhusain](https://forum.universal-robots.com/u/mouzzamhusain)\
**Post date:** [January 31, 2023, 3:43pm UTC](https://forum.universal-robots.com/t/timeout-error-with-vision-system/26445/7 "2023-01-31T15:43:08Z")

</div>

I tried what you suggested, but still the same error is occurring.

However, I am able to read the results from the vision system but not write/send commands.

Thanks for your suggestions.
