Using IF's in R-J3 controllers

  • Hello all.


    On R-J3 controller, I dont find the way to do this example code with out JUMP LBL.



    Quote

    IF R[1]=1 AND R[2]=1, DO[1]=TRUE.


    Only way is


    Quote

    IF R[1]=1 AND R[2]=1, JUMP LBL[1]


    LBL[1]
    DO[1]=TRUE



    Is there any way to simplify that? :merci:

  • Raltru,


    I'm not sure when Mixed Logic came into the FANUC control, but with Mixed logic you can do your first line of code. Mixed logic is the option with the parathesis '()'. Look on the second page of the IF menu. Should look something like IF(...)....I think.


    But, if you dont' have mixed logic, i would do the inverse of what you want and then jump over your DO[1]=True


    1. IF R[1]=/=1 or R[2]=/=1, JMPLBL[100]
    2. DO[1]=ON
    3. LBL[100]


    Good Luck!
    Tyler
    www.acieta.com

  • I also have several RJ3s with various versions of HandlingTool. None of them have the IF(...) statement.


    Alternatively you could use a program call


    1: IF R[1]<>1 OR R[2]<>1, CALL PRG001


    PRG001
    1: DO[1]=ON


    Depending on what you are doing with your process, you can add other lines in PRG001 to do whatever else happens along with the output turning on. Then you can potentially call this in other programs as well.

Advertising from our partners