# Variable num from pose

**URL:** <https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728>\
**Category:** RAPID Programming\
**Created:** [October 1, 2020, 7:43am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728 "2020-10-01T07:43:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehelgi](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mehelgi](https://tech-community.robotics.abb.com/u/Mehelgi)\
**Post date:** [October 1, 2020, 7:43am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/1 "2020-10-01T07:43:07Z")

</div>

Hello!  
After Search\_1D I have offset values in  
LOCAL PERS pose a:=[[x,y,z],[1,0,0,0]];.

LOCAL PERS pose b:=[[x,y,z],[1,0,0,0]];.

How I can extract values X from poses for variables num A, B?  
A:=…???  
B:=…???

It’s needed for use in command ArcC RelTool(p45,A,0,0),RelTool(p90,B,0,0)…  
Or may be I have mistake and you have more simple or more good variant.

---

<div class="post-metadata">

**Author:** ![jmf](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/jmf/32/762_2.png) [@jmf](https://tech-community.robotics.abb.com/u/jmf)\
**Post date:** [October 1, 2020, 8:34am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/2 "2020-10-01T08:34:55Z")

</div>

A:=pose\_a.trans.x;  
B:=pose\_b.trans.x;

---

<div class="post-metadata">

**Author:** ![Mehelgi](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mehelgi](https://tech-community.robotics.abb.com/u/Mehelgi)\
**Post date:** [October 1, 2020, 9:01am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/3 "2020-10-01T09:01:45Z")

</div>

So, I tried this, but it doesn’t work.

---

<div class="post-metadata">

**Author:** ![jmf](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/jmf/32/762_2.png) [@jmf](https://tech-community.robotics.abb.com/u/jmf)\
**Post date:** [October 1, 2020, 9:20am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/4 "2020-10-01T09:20:59Z")

</div>

> [@Mehelgi](#):
>
> Hello!  
> After Search\_1D I have offset values in  
> LOCAL PERS pose a:=[[x,y,z],[1,0,0,0]];.
> 
> LOCAL PERS pose b:=[[x,y,z],[1,0,0,0]];.
> 
> How I can extract values X from poses for variables num A, B?  
> A:=…???  
> B:=…???
> 
> It’s needed for use in command ArcC RelTool(p45,A,0,0),RelTool(p90,B,0,0)…  
> Or may be I have mistake and you have more simple or more good variant.

It might be because of your declaration. No spaces between declarations naming’s. Controller doesn’t like it.  
Also remove the “.” after the declarations.

Should be:  
LOCAL PERS pose\_a:=[[0,0,0],[1,0,0,0]];  
LOCAL PERS pose\_b:=[[0,0,0],[1,0,0,0]];

---

<div class="post-metadata">

**Author:** ![Mehelgi](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mehelgi](https://tech-community.robotics.abb.com/u/Mehelgi)\
**Post date:** [October 1, 2020, 9:37am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/5 "2020-10-01T09:37:34Z")

</div>

Values after Search\_1D:  
LOCAL PERS pose pePAT\_OK\_0:=[[-0.128607,-1.93481,-0.960388],[1,0,0,0]];

Declaration p\_0\_x:  
LOCAL VAR num p\_0\_x:=0;

After Search\_1D:  
p\_0\_x:=pePAT\_OK\_0.trans.x;

ArcLStart RelTool(p0,p\_0\_x,p\_0\_y,p\_0\_z),v200,seam1,weld9\Weave:=weave7,fine,tWeldGunCMT45\WObj:=wobjSTN2;

---

<div class="post-metadata">

**Author:** ![jmf](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/jmf/32/762_2.png) [@jmf](https://tech-community.robotics.abb.com/u/jmf)\
**Post date:** [October 1, 2020, 9:53am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/6 "2020-10-01T09:53:34Z")

</div>

What errors do you get?

---

<div class="post-metadata">

**Author:** ![Mehelgi](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mehelgi](https://tech-community.robotics.abb.com/u/Mehelgi)\
**Post date:** [October 1, 2020, 10:02am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/7 "2020-10-01T10:02:27Z")

</div>

The value doesn’t change and the trajectory doesn’t change too.

 ![2D3B76F5-9FAF-47BB-8B17-C172781996B2.jpeg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/489d2ae7a7ed1782451d9f12d54417edef03e3b8.jpeg)

---

<div class="post-metadata">

**Author:** ![jmf](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/jmf/32/762_2.png) [@jmf](https://tech-community.robotics.abb.com/u/jmf)\
**Post date:** [October 1, 2020, 10:48am UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/8 "2020-10-01T10:48:12Z")

</div>

Try to change it to a pers and do it after the search and before the rob movement.

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [October 1, 2020, 12:22pm UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/9 "2020-10-01T12:22:25Z")

</div>

The first post has a valid declaration of the pose, it is merely A and B, pose indicates data type. You do not have to break it down to the atomic level with x, y and z to assign the values, see below:  
VAR pos myPos:=[0,0,0];  
myPos:=A.trans;  
MoveL RelTool(myPick,myPos.x,myPos.y,myPos.z), speed, tool, blah, blah;  
To use those values in the RelTool, however, you must break it down as seen above.

---

<div class="post-metadata">

**Author:** ![Mehelgi](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mehelgi](https://tech-community.robotics.abb.com/u/Mehelgi)\
**Post date:** [October 1, 2020, 1:32pm UTC](https://tech-community.robotics.abb.com/t/variable-num-from-pose/9728/10 "2020-10-01T13:32:37Z")

</div>

So, I cut declaration part (p\_0\_x:=pePAT\_OK\_0.trans.x;) from search\_routine and moved it into welding\_routine before Arc commands. And now everything worked.  
Thank you very much for your help!
