Possible to compare current position to routine, flag bool as TRUE if it matches a robtarget within the routine?

  • I'm using RobotStudio to write an auto-recovery program for a Multimove IRC5 controller, beginning with Robot 1. The goal is to avoid having to manually jog the robots Home during an error state, instead simply selecting PP to Main.

    My process is as follows:

    The Main program checks if doHome_R1=0.

    If R1 is NOT at Home, the program will check a series of Boolean flags, each mapped to various positions the robot might be in.

    For example, if R1 is in Pos1, then bFlag1=TRUE and R1 homes from Pos1; if R1 is in Pos2, then bFlag2=TRUE and R1 homes from Pos2, etc.

    If R1 is NOT at Home and no flag is true, the teach pendant sends a message that the robot is in an unknown position and must be jogged manually.

    Is it possible to compare R1's current position to a specific routine and, if it matches a robtarget within the routine, makes the flag TRUE?

    Or is that impossible after PP to Main?

    I want to avoid writing something messy like this:

    PROC PosCheck_R1()

    VAR bool bFlag1;

    VAR robtarget rTemp;




    IF rTemp.trans.x>=823 AND rTemp.trans.x<824 AND rTemp.trans.y>=353 AND rTemp.trans.y<528 AND rTemp.trans.z>-300 AND rTemp.trans.z<-264 THEN



    Thank you.

  • MOM

    Approved the thread.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now