# ScriptExporter limitations?

**URL:** <https://forum.universal-robots.com/t/scriptexporter-limitations/27554>\
**Category:** Robot Communication\
**Created:** [March 23, 2023, 4:57am UTC](https://forum.universal-robots.com/t/scriptexporter-limitations/27554 "2023-03-23T04:57:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![francis](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@francis](https://forum.universal-robots.com/u/francis)\
**Post date:** [March 23, 2023, 4:57am UTC](https://forum.universal-robots.com/t/scriptexporter-limitations/27554/1 "2023-03-23T04:57:28Z")

</div>

I’m using the ScriptExporter to send a command then get the response of that command.  
I do this every 1 second to monitor the latest status of the peripheral attached to the robot.  
But after some time, the polyscope freezes. Further debugging puts this between 250~350 seconds.

After a lot of debugging, I found it stops at the `Socket returnSocket = server.accept();` line in the readValueFromRobot function of ScriptExporter.  
I tried fixing it by adding `server.setSoTimeout(2000);` right before the accept().  
This only prevented polyscope from freezing. After it triggers the timeout, it still does not get the response from the robot.

The command I send using ScriptExporter is as follows:  
socket\_open(peripheral IP, peripheral port)  
socket\_send\_byte(x) ← multiple lines depending on command and data  
socket\_read\_byte\_list(30)  
socket\_close()

I’m thinking this is more a ServerSocket issue and less a ScriptExporter issue but I know little of either to draw a conclusion.  
Anyone have any knowledge about this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 27, 2023, 1:22pm UTC](https://forum.universal-robots.com/t/scriptexporter-limitations/27554/2 "2023-03-27T13:22:18Z")

</div>

The script exporter classes are just really laggy, and if sent rapidly, will completely freeze the robot for a time like you’re seeing. I’ve not found any way to avoid this. If you figure something out, please let me know.

---

<div class="post-metadata">

**Author:** ![francis](https://avatars.discourse-cdn.com/v4/letter/f/ac8455/32.png) [@francis](https://forum.universal-robots.com/u/francis)\
**Post date:** [March 28, 2023, 1:26am UTC](https://forum.universal-robots.com/t/scriptexporter-limitations/27554/3 "2023-03-28T01:26:01Z")

</div>

Thanks for your reply, @eric.feldmann.

So far I haven’t found a fix for this.  
A workaround I’m considering is, instead of reading every second, I would just read on demand.

That is, instead of reading the position of the attachment every second, I would read the position after every movement to get it’s current position.
