# External axis GetPosition method

**URL:** <https://tech-community.robotics.abb.com/t/external-axis-getposition-method/1778>\
**Category:** Developer Tools\
**Created:** [April 2, 2008, 3:36pm UTC](https://tech-community.robotics.abb.com/t/external-axis-getposition-method/1778 "2008-04-02T15:36:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@neil](https://tech-community.robotics.abb.com/u/neil)\
**Post date:** [April 2, 2008, 3:36pm UTC](https://tech-community.robotics.abb.com/t/external-axis-getposition-method/1778/1 "2008-04-02T15:36:30Z")

</div>

Hi,

I am using the PC SDK (5.10) to get external values into a .Net application (Visual Studio 2005). I use the following code:

JointTarget jnt = controller.MotionSystem.ActiveMechanicalUnit.GetPosition();  
textBox1.Text = jnt.ExtAx.Eax\_a.ToString();  
textBox2.Text = jnt.ExtAx.Eax\_b.ToString();  
textBox3.Text = jnt.ExtAx.Eax\_c.ToString();

All ExtAx values are 0, even though actual external axis positions are not 0.

If I use the following code:

textBox3.Text = exJnt.RobAx.Rax\_1.ToString();  
textBox4.Text = exJnt.RobAx.Rax\_2.ToString();  
textBox5.Text = exJnt.RobAx.Rax\_3.ToString();

then the correct values of the external axis positions are returned. Printing the object exJnt to screen gives:  
[eax\_a, eax\_b, eax\_c, eax\_d, 0 0] [0 0 0 0 0 0]

Does this mean that I cannot get access to RobAx values?  
Why are the Rax values returning Eax values??

I thought that it may have something to do with the ActiveMechanicalUnit property but there is no GetPosition() method associated with MechanicalUnit, as stated in the PC SDK Reference. The PC SDK Reference also states that GetPosition does not support external axes but another thread on this forum says it is supported ([http://forums.robotstudio.com/forum\_posts.asp?T ID=1812&KW=external+axis](http://forums.robotstudio.com/forum_posts.asp?TID=1812&KW=external+axis))

Any help appreciated,  
Regards,  
Neil

---

<div class="post-metadata">

**Author:** ![berrie](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@berrie](https://tech-community.robotics.abb.com/u/berrie)\
**Post date:** [April 3, 2008, 4:15pm UTC](https://tech-community.robotics.abb.com/t/external-axis-getposition-method/1778/2 "2008-04-03T16:15:29Z")

</div>

Hi Neil,

I had the same problem. The getposition doesn’t return the external axis. You have to walk through the mechanical units with a foreach loop to get the external axis.

MotionSystem msystem = ctrl.MotionSystem;

foreach (MechanicalUnit munit in msystem.MechanicalUnits)

{

Console.WriteLine("MechUnit " + munit.ToString());

Console.WriteLine("Tool " + munit.Tool.ToString());

Console.WriteLine(“JointPosition: {0}”, munit.GetPosition());

}

This is working for me.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/system/32/6_2.png) [@system](https://tech-community.robotics.abb.com/u/system)\
**Post date:** [April 7, 2008, 4:16pm UTC](https://tech-community.robotics.abb.com/t/external-axis-getposition-method/1778/3 "2008-04-07T16:16:39Z")

</div>

Hi Neil and Berrie!

Yes, there is a bug in the PC SDK. The joints values are always copied to the Rax values even though it is an external axis. This will be fixed in the next release. Until then you’ll have to do as Berrie described.

Thank you very much for letting us know about the problem.

Best Regards,  
Susanne
