# Limit for socker\_read\_string()?

**URL:** <https://forum.universal-robots.com/t/limit-for-socker-read-string/1916>\
**Category:** URScript\
**Created:** [April 23, 2018, 6:20pm UTC](https://forum.universal-robots.com/t/limit-for-socker-read-string/1916 "2018-04-23T18:20:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon94514666](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@anon94514666](https://forum.universal-robots.com/u/anon94514666)\
**Post date:** [April 23, 2018, 6:20pm UTC](https://forum.universal-robots.com/t/limit-for-socker-read-string/1916/1 "2018-04-23T18:20:03Z")

</div>

Hi there!

I am writing a URScript program for a SW3.0 controller, and need to send string messages via TCP. I can successfully use `socket_read_string()` to get them, but I cannot figure out a way to mark the string as finished, and read a new one. I see that starting SW3.1there are _prefix_ and _suffix_ options, but I need something that works in 3.0.

Is there any control character I can use to stop the string reader and move on to the next instruction?

Thanks!

JL

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [April 24, 2018, 9:19am UTC](https://forum.universal-robots.com/t/limit-for-socker-read-string/1916/2 "2018-04-24T09:19:18Z")

</div>

You can update a hardware CB3.0 controller (the one with the flash card if you open the CB) all the way up to the latest PolyScope software (in steps 3.0 -\> 3.1 -\> 3.2 -\> …).  
So if you have no particular reason for running such an old software, I suggest updating the SW to get all the latest features, including the socket suffix and prefix options.

---

<div class="post-metadata">

**Author:** ![anon94514666](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@anon94514666](https://forum.universal-robots.com/u/anon94514666)\
**Post date:** [April 24, 2018, 2:28pm UTC](https://forum.universal-robots.com/t/limit-for-socker-read-string/1916/3 "2018-04-24T14:28:04Z")

</div>

Thanks @jbm. This is not an option, as the robot is not mine, I don’t want to be responsible for problems that may arise from an upgrade, and I would like to create a general solution that is compatible with as many versions as possible, including 3.0.

I guess you are saying there is no way to read a controlled amount of bytes from a socket buffer and turn it into a string in SW3.0?

[https://github.com/RobotExMachina/Machina-UR-Driver](https://github.com/RobotExMachina/Machina-UR-Driver)

Thanks!
