# Obtain attached arm length via UR script

**URL:** <https://forum.universal-robots.com/t/obtain-attached-arm-length-via-ur-script/35793>\
**Category:** URScript\
**Created:** [August 26, 2024, 6:51pm UTC](https://forum.universal-robots.com/t/obtain-attached-arm-length-via-ur-script/35793 "2024-08-26T18:51:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrhine](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mrhine](https://forum.universal-robots.com/u/mrhine)\
**Post date:** [August 26, 2024, 6:51pm UTC](https://forum.universal-robots.com/t/obtain-attached-arm-length-via-ur-script/35793/1 "2024-08-26T18:51:18Z")

</div>

Is there a function in the UR script that can return which length of UR arm is currently attached?

I’m working on multiple palletizing applications with varying UR arms (we use 10e, 20e, 30e). Currently we copy the script from one to another and change a few distance/ reach related variables each time but it would be very nice to skip this step all together.

---

<div class="post-metadata">

**Author:** ![robin\_gdwl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/robin_gdwl/32/2676_2.png) [@robin\_gdwl](https://forum.universal-robots.com/u/robin_gdwl)\
**Post date:** [August 27, 2024, 3:42pm UTC](https://forum.universal-robots.com/t/obtain-attached-arm-length-via-ur-script/35793/2 "2024-08-27T15:42:03Z")

</div>

There is probably an easier way of doing this. But I cant think of any.  
My idea would be to have a joint setting and corresponding TCP Positions for each robot.

If you want to know which robot is running the script call ‘get\_inverse\_kinematics(joint\_position)’ and check the result against the 3 possible ones.

---

<div class="post-metadata">

**Author:** ![nrivas1](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@nrivas1](https://forum.universal-robots.com/u/nrivas1)\
**Post date:** [August 27, 2024, 5:38pm UTC](https://forum.universal-robots.com/t/obtain-attached-arm-length-via-ur-script/35793/3 "2024-08-27T17:38:21Z")

</div>

You should be able to do socket communication to the Dashboard and pull the Robot model from there.
