# How to find distance from TCP to next target?

**URL:** <https://tech-community.robotics.abb.com/t/how-to-find-distance-from-tcp-to-next-target/10809>\
**Category:** RAPID Programming\
**Tags:** rapid, 3dprinting\
**Created:** [July 12, 2022, 1:01pm UTC](https://tech-community.robotics.abb.com/t/how-to-find-distance-from-tcp-to-next-target/10809 "2022-07-12T13:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimoH](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@SimoH](https://tech-community.robotics.abb.com/u/SimoH)\
**Post date:** [July 12, 2022, 1:01pm UTC](https://tech-community.robotics.abb.com/t/how-to-find-distance-from-tcp-to-next-target/10809/1 "2022-07-12T13:01:53Z")

</div>

Hi,

Is there way to know distance of TCP to next target or coordinates of next target?

I’m trying to make 3D-printer use E-values that I get from goEvalue\_3DP from 3DP powerpac. Problem is that, to calculate feeding value to extruder, I would need to know distance between previous and next target.  
As powerpac encrypts robot path file, I cannot use target coordinates from there to find the distance.

So is there any instruction etc. that would allow me to find robots current target or distance that robot has to move to that target?

Thanks

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 12, 2022, 1:12pm UTC](https://tech-community.robotics.abb.com/t/how-to-find-distance-from-tcp-to-next-target/10809/2 "2022-07-12T13:12:10Z")

</div>

There is a function for distance from one target to another, Dist(). For retrieving the current position, the function is CRobT().

---

<div class="post-metadata">

**Author:** ![EricH](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@EricH](https://tech-community.robotics.abb.com/u/EricH)\
**Post date:** [July 21, 2022, 7:34am UTC](https://tech-community.robotics.abb.com/t/how-to-find-distance-from-tcp-to-next-target/10809/3 "2022-07-21T07:34:15Z")

</div>

Careful, that distance is only a distance between points and not the interpolated path.
