# String to number conversion and checking the reachability in RAPID

**URL:** <https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766>\
**Category:** RobotStudio\
**Created:** [October 11, 2013, 9:23am UTC](https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766 "2013-10-11T09:23:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pion3k](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@pion3k](https://tech-community.robotics.abb.com/u/pion3k)\
**Post date:** [October 11, 2013, 9:23am UTC](https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766/1 "2013-10-11T09:23:17Z")

</div>

Hello,

I need some help with the following problems:

1. Is it possible to somehow convert a string (in my case received through a socket) to the equivalent data but in a number type in RAPID? I have tried with StrToByte but the problem is that I’m significantly limited by the range of the byte type (0 - 255 without negative values). What I need is to send by the socket the position of the robotic arm and, as you know, the position of the effector can quite a bit exceed the limit (255). I thought about multiplying the values but in this case I would lose a possibility of reaching intermediate points. And still, what about negative values?

2. How can I check a reachability of a specified point by a RAPID code? Generally, my program crashes now when the coordinates of the demanded point are exceeding the robot’s workspace limit.

---

<div class="post-metadata">

**Author:** ![kioog](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kioog](https://tech-community.robotics.abb.com/u/kioog)\
**Post date:** [October 14, 2013, 9:57am UTC](https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766/2 "2013-10-14T09:57:10Z")

</div>

hello,

1. you can use strtoval for converting string to numbers

2. you can use CalcJointT for checking reach, if it gives an error ERR\_ROBLIMIT then you know the robot cannot reach the position

BR

Peter

---

<div class="post-metadata">

**Author:** ![Engineer345](https://avatars.discourse-cdn.com/v4/letter/e/838e76/32.png) [@Engineer345](https://tech-community.robotics.abb.com/u/Engineer345)\
**Post date:** [October 14, 2013, 6:43pm UTC](https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766/3 "2013-10-14T18:43:42Z")

</div>

Hello,  
i have the same problem , i have this variable  
VAR string Fx\_S1:=0.784184821186377;  
i have imported from C# addin , and when i use the command  
VAR strtoval Fx\_S1;  
it gives me the following error :  
IRB4400\_60kg\_1.96m\_245/RAPID/T\_ROB1/MainModule(3,2): Name error(49): Variable name x\_S1 ambiguous. 10/14/2013 8:40:28 PM General  
Checked: IRB4400\_60kg\_1.96m\_245/RAPID/T\_ROB1: 1 semantic errors. 10/14/2013 8:40:28 PM RAPID  
any help is really appreciated

---

<div class="post-metadata">

**Author:** ![Engineer345](https://avatars.discourse-cdn.com/v4/letter/e/838e76/32.png) [@Engineer345](https://tech-community.robotics.abb.com/u/Engineer345)\
**Post date:** [October 14, 2013, 7:00pm UTC](https://tech-community.robotics.abb.com/t/string-to-number-conversion-and-checking-the-reachability-in-rapid/5766/4 "2013-10-14T19:00:35Z")

</div>

i have found the error it was in the format of using StrToVal
