# Socket communication crashing

**URL:** <https://tech-community.robotics.abb.com/t/socket-communication-crashing/11449>\
**Category:** RAPID Programming\
**Created:** [May 22, 2024, 7:34am UTC](https://tech-community.robotics.abb.com/t/socket-communication-crashing/11449 "2024-05-22T07:34:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![primoz](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@primoz](https://tech-community.robotics.abb.com/u/primoz)\
**Post date:** [May 22, 2024, 7:34am UTC](https://tech-community.robotics.abb.com/t/socket-communication-crashing/11449/1 "2024-05-22T07:34:04Z")

</div>

Hello!

I have a program for 3d bin picking, and i am connected via TCP/IP to an external computer. In the program below i create a socket and connect to it. My question is when i start the program in manual mode from main procedure i can normally connect and it works fine, but if i stop in another procedure and have to move the program pointer to another procedure the communication crashes and i get disconnected from the port. What can i do or is there an explanation to why it happens?

Program:

PROC TcpIpInicializacija()

VAR socketdev ABB\_PC\_socket;

VAR string IPaddress:=“192.168.1.124”;

VAR num PortNumber:=20001;

SocketClose ABB\_PC\_socket;

WaitTime 0.05;

SocketCreate ABB\_PC\_socket;

SocketConnect ABB\_PC\_socket,IPaddress,PortNumber,\Time:=WAIT\_MAX;

ENDPROC

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [May 22, 2024, 4:34pm UTC](https://tech-community.robotics.abb.com/t/socket-communication-crashing/11449/2 "2024-05-22T16:34:21Z")

</div>

Hello,  
You may use an other task to manage this.
