Socket_open() issue

Dear,

I use socket_open() to connect to a remote PC. I first launch the PC program, then I switch on the robot and start my script. Quite often, the script just stops running. It’s because the socket_open() times out after 2 seconds. On some days, it works on the first try on others I have to re-start 5 or 6 times.

I can, of course, write a little loop that checks the result of socket_open(), but there’s 2 issues: 1) I also have an older UR5 with URscript that doesn’t return a result for socket_open() (only later versions do) and 2) I just want to understand why the problem occurs so I can solve the problem, rather then treat the symptoms…

Thanks.