Background logic - UO[6]

  • Hello,


    I am using background program to turn all outputs off when an error occurs:


    Code:


    LBL[1]

    IF UO[6: FAULT] = ON JUMP LBL[2]

    JMP LBL[1]


    LBL[2]

    DO[101] = OFF

    DO[102] = OFF


    However, I get the error: INTP-202.

    How can I fix this simple problem?

  • You cannot jump back in BG logic, only forward. Jump labels aren't necessary anyways. Also, use the If statement with parenthesis. BGlogic automatically loops.


    Just use this:


    If (UO[6]) Then

    DO[101] = OFF

    DO[102] = OFF

    End If

  • Thank you HawkME .


    When I go to Background Logic: MENU > SETUP > BG Logic, my Program: DEMO_BG got STATUS; Stop. I feel ike it never runs.


    Can you explain why?

    When I manually set RUN.

    The following error occurs: Invalid Item for Mixed Logic..


    I am on a fanuc robot LR 200iC/5L, software version 7.50

    So I can use IF statement, but not IF THEN


    Code:

    --------------------------------------------------------

    Program name: DEMO_BG:


    IF (UO[6: Fault]), CALL DEMO_IO_OFF


    --------------------------------------------------------

    Program name: DEMO_IO_OFF:


    DO[101] = OFF

    DO[102] = OFF

Advertising from our partners