# Position validation

**URL:** <https://tech-community.robotics.abb.com/t/position-validation/4625>\
**Category:** Developer Tools\
**Created:** [January 18, 2012, 3:33pm UTC](https://tech-community.robotics.abb.com/t/position-validation/4625 "2012-01-18T15:33:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zevh](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zevh](https://tech-community.robotics.abb.com/u/zevh)\
**Post date:** [January 18, 2012, 3:33pm UTC](https://tech-community.robotics.abb.com/t/position-validation/4625/1 "2012-01-18T15:33:52Z")

</div>

I have a need to calculate potential positions offline and then validate them once I get online.

What is the best way to check if a given Cartesian position is reachable once connected to a live robot?

---

<div class="post-metadata">

**Author:** ![msalminen](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@msalminen](https://tech-community.robotics.abb.com/u/msalminen)\
**Post date:** [January 19, 2012, 1:54pm UTC](https://tech-community.robotics.abb.com/t/position-validation/4625/2 "2012-01-19T13:54:45Z")

</div>

Hi,

I have made following RAPID function for that

FUNC bool IsReachable(robtarget pReach, PERS tooldata ToolReach, PERS wobjdata WobjReach)  
VAR bool bReachable;  
VAR jointtarget jntReach;

bReachable := TRUE;

jntReach := CalcJointT(pReach, ToolReachWobj:=WobjReach);

RETURN bReachable;

ERROR  
IF ERRNO = ERR\_ROBLIMIT THEN  
bReachable := FALSE;  
TRYNEXT;  
ENDIF  
ENDFUNC

Regards,  
Mika

---

<div class="post-metadata">

**Author:** ![zevh](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zevh](https://tech-community.robotics.abb.com/u/zevh)\
**Post date:** [January 20, 2012, 5:32am UTC](https://tech-community.robotics.abb.com/t/position-validation/4625/3 "2012-01-20T05:32:04Z")

</div>

Thank you for the code.

---

<div class="post-metadata">

**Author:** ![fenny](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fenny](https://tech-community.robotics.abb.com/u/fenny)\
**Post date:** [January 23, 2012, 5:35pm UTC](https://tech-community.robotics.abb.com/t/position-validation/4625/4 "2012-01-23T17:35:41Z")

</div>

hey,

I am trying to use the similar code  
but my program goes to the error routine but it does return to the end of the procedure,  
but i have specified TRYNEXT;

Any suggestions
