# Zero External Axis in Rapid

**URL:** <https://tech-community.robotics.abb.com/t/zero-external-axis-in-rapid/5206>\
**Category:** Robot Controller\
**Created:** [November 13, 2012, 12:36pm UTC](https://tech-community.robotics.abb.com/t/zero-external-axis-in-rapid/5206 "2012-11-13T12:36:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiamGwallace](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@LiamGwallace](https://tech-community.robotics.abb.com/u/LiamGwallace)\
**Post date:** [November 13, 2012, 12:36pm UTC](https://tech-community.robotics.abb.com/t/zero-external-axis-in-rapid/5206/1 "2012-11-13T12:36:51Z")

</div>

I need reset an external axis to zero using RAPID code. The IndReset command only resets the axis to a multiple of 360 away from the original value.  
This is on an S4C robot.

What I am looking to do is something like this.

PROC AxisReset()  
VAR num regAXIS:=0;  
VAR num regFK:=0;  
WHILE regFK\<\> 3 DO  
IndAMove M7, 1ToAbsNum:=regAXIS, 5;  
WaitUntil IndInpos(M7,1)=TRUE;  
TPErase;  
TPReadFK regFK,“What direction?”,“”,“Left”,“Reset”,“Right”,“”;  
TEST regFK  
CASE 2:  
regAXIS:=regAXIS-2;  
CASE 4:  
regAXIS:=regAXIS+2;  
ENDTEST  
ENDWHILE  
!!!  
!Axis reset command here  
!!!  
ENDPROC

Liam Wallace

---

<div class="post-metadata">

**Author:** ![Steve\_Murphy](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@Steve\_Murphy](https://tech-community.robotics.abb.com/u/Steve_Murphy)\
**Post date:** [November 18, 2012, 7:21pm UTC](https://tech-community.robotics.abb.com/t/zero-external-axis-in-rapid/5206/2 "2012-11-18T19:21:23Z")

</div>

Hello Liam,

Unfortunately there is no command in the RAPID Independent Axis function that will zero the axis after a motion. I can only suggest that after a reset, move the axis back to zero if that would work.

Kind Regards,

Steve
