# Write variable from socket

**URL:** <https://forum.universal-robots.com/t/write-variable-from-socket/16996>\
**Category:** Robot Communication\
**Created:** [October 12, 2021, 5:11am UTC](https://forum.universal-robots.com/t/write-variable-from-socket/16996 "2021-10-12T05:11:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![androidflorent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/androidflorent/32/3314_2.png) [@androidflorent](https://forum.universal-robots.com/u/androidflorent)\
**Post date:** [October 12, 2021, 5:11am UTC](https://forum.universal-robots.com/t/write-variable-from-socket/16996/1 "2021-10-12T05:11:11Z")

</div>

I want to remotely write global variables. I manage to do it by sending the following code through Primary Interface, but it pauses the running program :

```auto
def func():
     global var1=0
end

```

So I tried with a “sec” program, but it has no effect on global variable :

```auto
sec func():
     global var1=0
end

```

How to write a variable without affecting the main program ? If not possible, is there a way to resume the main program ? (I did not find this feature in the Dashboard server protocol)
