# Movment single coordinate

**URL:** <https://tech-community.robotics.abb.com/t/movment-single-coordinate/6799>\
**Category:** Robot Controller\
**Created:** [September 14, 2015, 11:33am UTC](https://tech-community.robotics.abb.com/t/movment-single-coordinate/6799 "2015-09-14T11:33:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrizio](https://avatars.discourse-cdn.com/v4/letter/p/3bc359/32.png) [@Patrizio](https://tech-community.robotics.abb.com/u/Patrizio)\
**Post date:** [September 14, 2015, 11:33am UTC](https://tech-community.robotics.abb.com/t/movment-single-coordinate/6799/1 "2015-09-14T11:33:17Z")

</div>

Hello, in RAPID is possible to create a function to perform a movement of a single coordinated interpolated at the last movment?  
For example  
MoveL pPoint, vmax, z100, tGrip;  
MoveL Move\_XYZ (0,0,300), Vmax, z100, tGrip;

where the function Move\_XYZ is the following:

**FUNC robtarget Move\_XYZ (num PosX, PosY num, num PosZ)**  
**VAR robtarget PosXYZ;**

**PosXYZ: = CRobT ();**  
**IF (PosX \<\> 0) THEN**  
**PosXYZ.trans.x: = PosX;**  
**ENDIF**

**IF (PosY \<\> 0) THEN**  
**PosXYZ.trans.y: = PosY;**  
**ENDIF**

**IF (PosZ \<\> 0) THEN**  
**PosXYZ.trans.z: = PosZ;**  
**ENDIF**

**RETURN PosXYZ;**  
**ENDFUNC**

I have the need that the movement derived from the function is interpolated to the previous movment but that the coordinates of the robot used to perform the function are those of arrival of pPoint. How can I do. Thank you!

---

<div class="post-metadata">

**Author:** ![kioog](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kioog](https://tech-community.robotics.abb.com/u/kioog)\
**Post date:** [October 13, 2015, 10:11am UTC](https://tech-community.robotics.abb.com/t/movment-single-coordinate/6799/2 "2015-10-13T10:11:20Z")

</div>

Hello,

you can do the following:

func robtarget Move\_XYZ(INOUT robtarget PosXYZ,num PosX,num PosY,num PosZ)  
IF (PosX\<\>0) PosXYZ.trans.x:=PosXYZ.trans.x+PosX;  
IF (PosY\<\>0) PosXYZ.trans.y:=PosXYZ.trans.y+PosY;  
IF (PosZ\<\>0) PosXYZ.trans.z:=PosXYZ.trans.z+PosZ;  
RETURN PosXYZ;  
ENDfunc

then executing each movement below will move according to previous movement

var robtarget tPoint;  
tPoint:=pPoint;  
MoveL Move\_XYZ(tPoint,0,0,0),vmax,z100,tGrip;  
MoveL Move\_XYZ(tPoint,0,0,300),vmax,z100,tGrip;  
MoveL Move\_XYZ(tPoint,100,0,0),vmax,z100,tGrip;

or you can execute directly  
MoveL Move\_XYZ(pPoint,0,0,0),vmax,z100,tGrip;  
MoveL Move\_XYZ(pPoint,0,0,300),vmax,z100,tGrip;  
MoveL Move\_XYZ(pPoint,100,0,0),vmax,z100,tGrip;  
but then you modify the coordinates of your pPoint, i dont know if you need it for later on in your program.

BR  
Peter

---

<div class="post-metadata">

**Author:** ![amardebbari](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@amardebbari](https://tech-community.robotics.abb.com/u/amardebbari)\
**Post date:** [October 14, 2015, 10:22am UTC](https://tech-community.robotics.abb.com/t/movment-single-coordinate/6799/3 "2015-10-14T10:22:05Z")

</div>

MoveL offs(pPoint,0,0,0),vmax,z100,tGrip;  
MoveL offs(pPoint,0,0,300),vmax,z100,tGrip;  
MoveL offs(pPoint,100,0,0),vmax,z100,tGrip;  
but then you modify the coordinates of your pPoint

BR  
Amar
