# Secoondary program stops program

**URL:** <https://forum.universal-robots.com/t/secoondary-program-stops-program/34948>\
**Category:** Robot Communication\
**Created:** [June 27, 2024, 10:24am UTC](https://forum.universal-robots.com/t/secoondary-program-stops-program/34948 "2024-06-27T10:24:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorge1](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jorge1](https://forum.universal-robots.com/u/jorge1)\
**Post date:** [June 27, 2024, 10:24am UTC](https://forum.universal-robots.com/t/secoondary-program-stops-program/34948/1 "2024-06-27T10:24:26Z")

</div>

Hello forum, I am using socket communication to send a secondary program, following this example, but it stops the execution of the main program. I would like to write to logs, but to start, I am writing the status of an output. What am I doing wrong? I send the command through port 30002.

Here is my code in python:

HOST = “192.168.1.5”  
PORT = 30002  
i = 0  
while True:  
with socket.socket(socket.AF\_INET, socket.SOCK\_STREAM) as s:  
s.connect((HOST, PORT))  
data = s.recv(1024)  
str\_send = b"sec secondaryProgram():\n set\_digital\_out(1,True)\n end\n"  
s.sendall(str\_send)  
data = s.recv(1024)  
time.sleep(1)  
i = i +0.01  
print(f"Received {data!r}")
