RobotStudio event

Comparation robtargets

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

Regards Szily

Comments

  • I forgot to mention that Approach is robtarget!
    Regards Szily


  • 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!
  • Thank you very much! It helped a lot.
    Regards Szily
  • 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
    Regards Szily


  • After StopMove insert the instruction ClearPath;
    This will make the robot to "forget" it`s path ;)
     
    Good luck!!
  • Thanks very much! It worked Smile 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
    Regards Szily