# changing/adding one parameter in a robottarget

**URL:** <https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531>\
**Category:** Robot Controller\
**Created:** [November 16, 2011, 2:51pm UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531 "2011-11-16T14:51:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahaboid](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/shahaboid/32/3296_2.png) [@shahaboid](https://tech-community.robotics.abb.com/u/shahaboid)\
**Post date:** [November 16, 2011, 2:51pm UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/1 "2011-11-16T14:51:08Z")

</div>

Hi,

I am new to ABB robots and trying to write a small program that can make the robot to weld a hollow box. It would say I need a 4 base positions on a rectangle and MoveL between them. This gives me a single layer of the hollow box and if I continue this by incrementing the Z value then I would get walls of the box as well. [img][http://gabijack.com/wp-content/webwiz/2008/12/shell3.jpg[img]](http://gabijack.com/wp-content/webwiz/2008/12/shell3.jpg%5Bimg%5D).

My question now is that how can I only update the Z value of one point. In the following example code, I want to change the value of -25, which is Z.

```auto
PERS robtarget test_point:=[[410,125,-25],[0,0.999858168,0,-0.016841704],[0,-1,0,0],[9E9,0,9E9,9E9,0,9E9]];
num index:=0;
...
WHILE index < 10 DO
MoveL testpoint, ...
index := index + 10;
test_point (1)(3):=index; **!I dont know how to write this in RAPID syntax !!!!**
ENDWHILE

```

if you know a better way to do this, plz let me know ???

P.S. one way to fix this is to use a numeric variable instead of the numbers later in your program, but still not the best way to program :stuck_out_tongue:

```auto
PROC updateHeight (num layerNum)
! ---- First side of the substrate
hDist_1 := -25 + ( layerNum * 75 );
hDist_2 := -65 + ( layerNum * 75 );
point1_1 := [[410,1925,hDist_1],...;
! ---- Second side of the substrate
point2_8:=[[410,125,hDist_2],...;
ENDPROC
```

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://tech-community.robotics.abb.com/u/Marcel)\
**Post date:** [November 16, 2011, 4:07pm UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/2 "2011-11-16T16:07:56Z")

</div>

Hi

You could use:  
MoveL Offs(testpoint,0,0,-40),…  
or

MoveL RelTool(testpoint,0,0,-40),…  
(that depends on the tool orientation)

best regards  
Marcel

---

<div class="post-metadata">

**Author:** ![mattdavis](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mattdavis](https://tech-community.robotics.abb.com/u/mattdavis)\
**Post date:** [November 17, 2011, 12:37am UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/3 "2011-11-17T00:37:06Z")

</div>

or you can access the robtarget parameters with

robtarget.trans.z := robtarget.trans.z + 40;

have a look in the technical reference and you will see all the subtypes of the robtarget available.

also I would generally use 12 points to weld a rectangle. (to maintain the desired push/drag angle as long as possible on the straight sections and just rotate it into and out of the corners).

---

<div class="post-metadata">

**Author:** ![shahaboid](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/shahaboid/32/3296_2.png) [@shahaboid](https://tech-community.robotics.abb.com/u/shahaboid)\
**Post date:** [November 21, 2011, 10:11am UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/4 "2011-11-21T10:11:38Z")

</div>

Thanks for the help from all of you 🙂 I preffered to use

```auto
FOR i FROM 1 TO 5 DO
MoveL Offs(testpoint,Xoffs,Yoffs,Zoffs),...
ENDFOR
```

As I could change Xoffset, Yoffset and Zoffset at the same time and could both come up in height and at the same time weld the same shape several times on one plate(X,Y shifting the same shape).

---

<div class="post-metadata">

**Author:** ![chincp](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@chincp](https://tech-community.robotics.abb.com/u/chincp)\
**Post date:** [February 17, 2012, 1:31am UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/5 "2012-02-17T01:31:53Z")

</div>

Hi,

I have tried the same format for  
robtarget.p1.tranz.y:=robtarget.p1.tranz.y+96.3;

and changed the command to  
jointtarget.jp1.robax.rax\_6:=jointtarget.jp1.robax.rax\_6+45;  
in order to rotate the robot arm by 45 degrees after a certain command.  
However, robotstudio online prompt error for this line.  
Is there any thing that we have written wrongly?

Thanks!

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://tech-community.robotics.abb.com/u/Marcel)\
**Post date:** [February 17, 2012, 9:43am UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/6 "2012-02-17T09:43:51Z")

</div>

Hi chincp

jp1.robax.rax\_6:=jp1.robax.rax\_6+45;  
jointtarget has to be: PERS or VAR and not: CONST

Best regards  
Marcel

---

<div class="post-metadata">

**Author:** ![chincp](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@chincp](https://tech-community.robotics.abb.com/u/chincp)\
**Post date:** [February 21, 2012, 6:57am UTC](https://tech-community.robotics.abb.com/t/changing-adding-one-parameter-in-a-robottarget/4531/7 "2012-02-21T06:57:32Z")

</div>

Thanks a lot Marcel! Will try it out later. =D
