# Comparation robtargets

**URL:** <https://tech-community.robotics.abb.com/t/comparation-robtargets/4991>\
**Category:** Robot Controller\
**Created:** [July 18, 2012, 1:43pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991 "2012-07-18T13:43:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [July 18, 2012, 1:43pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/1 "2012-07-18T13:43:49Z")

</div>

Hi all!

I’ve got a task, where i have to define the actual position (CPos) or robtarget (CRobT) of the robot. This works, I can read them, but is it possible to compare two robtargets x,y or z possitions and based on the comparation should do a movement.

Like this:

PROC Compare()

posStud:=CPos(…  
posLab:=CPos(…

IF posstud.x \> Approach.x AND posstud.y\> Approch.y THEN  
!Move the robot up and turn (just en example)  
ELSEIF  
!Something else  
ENDIF

So my question is, is it possible to compare robtargets x,y or z possitions?

If I try it says:

Reference to unknown component x

Or is it possible, to read from an existing robtarget the x, y and z positions?

Can you suggest something, how to do it?

I`d need this for an automatic HOME movement (I want the user just push a button then the rapid programming will solve the rest. Or is it other type of HOME movement?

Thanks

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [July 18, 2012, 1:45pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/2 "2012-07-18T13:45:10Z")

</div>

I forgot to mention that Approach is robtarget!

---

<div class="post-metadata">

**Author:** ![jyrgen](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jyrgen](https://tech-community.robotics.abb.com/u/jyrgen)\
**Post date:** [July 19, 2012, 8:01am UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/3 "2012-07-19T08:01:43Z")

</div>

Try this  
IF posstud.x \> Approach.trans.x AND posstud.y\> Approch.trans.y THEN  
Robtarget has another structure of data types that you need to consider…

Good luck!

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [July 24, 2012, 4:38pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/4 "2012-07-24T16:38:13Z")

</div>

Thank you very much! It helped a lot.

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [July 24, 2012, 4:49pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/5 "2012-07-24T16:49:32Z")

</div>

Hi all!

Now can somebody tell me, how to stop the moving process of the robot. The task is: My robot moves along a path, and the user stops the robot manually (switch to manual mode) then pushes the Move home button. The robot after this action reads the actual position (this happens and it works well) and with an offset of 100mm moves toward and then HOME. **BUT** the **problem** is, that the robot still want`s to **reach** the **next** Robtarget (that was coming during the movement) and **only after that** , moves to the offset. Here is a part of my program:

IF posStud.x \< Approach.trans.x THEN  
StopMove;  
TPWrite “Value is SMALLER then specified”;  
TPReadFK reg1, “Move home?”, stEmpty,stEmpty,stEmpty,“Yes”, “No”;  
IF reg1 = 4  
StartMove;  
VelSet 25,800;  
act\_pos\_home:=CRobT();  
home\_moving\_var:=Offs(act\_pos\_home,100,0,0);  
MoveL home\_moving\_var, v500, fine,…  
MoveJ Home, v500, fine, tStudWObj:=Wo\_ArmeringsBunt;  
TPErase;  
ExitCycle;  
ELSEIF reg1 = 5 THEN  
MoveJ act\_pos\_home, v500, fine,…  
StartMove;

How can I stop the movement of robot and just start it from the reading of actual position, offset it and move home? I tried with STOPMOVE, STOP, EXIT

Can help me somebody?

Thank you

---

<div class="post-metadata">

**Author:** ![jhansson](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jhansson](https://tech-community.robotics.abb.com/u/jhansson)\
**Post date:** [July 31, 2012, 3:06pm UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/6 "2012-07-31T15:06:21Z")

</div>

After StopMove insert the instruction ClearPath;

This will make the robot to “forget” it`s path 😉  
Good luck!!

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [August 6, 2012, 9:54am UTC](https://tech-community.robotics.abb.com/t/comparation-robtargets/4991/7 "2012-08-06T09:54:49Z")

</div>

Thanks very much! It worked 😉 But than why couldn’t find this instruction in the rapid instructiuon manual or other manual. I have at least 2-3 manuals and nowhere could find it.

Anyway, thank you very much.

Greatings
