macro execution

  • So I have something weird going on that I’m not sure what to do. I have a cell with three robots. R1 has 4 groups. The robot, a dial table, and two rotating positioners. There is handshaking between all of the robots that works well most of the time.


    R1 has a DI that it waits for to move the positioners. The DI comes from the PLC, where it is enabled by DO’s from R2 and R3 that tells R1 that they are done and out of the way. The cell gets stuck sometimes when R1 is waiting for the DO’s from R2 and R3 (they are set in a macro), but R2 and R3 are past the macro execution, and one line before they turn the DO off that should have been set in the macro.


    Hopefully this makes sense…


    This is the code where R1 gets stuck, this is inside a macro. It is stuck at line 274: WAIT DI[88:TaskCompAck 12]=ON–

    265: !-------------------------------- ;

    266: !Task Complete 12 ;

    267: !-------------------------------- ;

    268: LBL[120] ;

    269: ;

    270: ! Set Task Complete 12= ON ;

    271: DO[88:TaskComplete 12]=ON ;

    272: ;

    273: ! Wait for Task Complete 12= ON ;

    274: WAIT DI[88:TaskCompAck 12]=ON ;


    This is where R2 and R3 are at(programs are identical). The macro SETCOMPLETE(12) is what sets on DO[88] –


    71: EXITFIXTURE(2) ;

    72: SETCOMPLETE(12) ;

    73: WAIT (DI[12:B @ ROBOT]=ON AND DI[18:B @ Weld 2]=ON) ;

    74: DO[88:TaskComplete 12]=OFF ;

    75: ENTERFIXTURE(2) ;


    Here is the logic that should be executing within the SETCOMPLETE(12) macro –


    !-------------------------------- ;

    266: !Task Complete 12 ;

    267: !-------------------------------- ;

    268: LBL[120] ;

    269: ;

    270: ! Set Task Complete 12= ON ;

    271: DO[88:TaskComplete 12]=ON ;

    272: ;

    273: ! Wait for Task Complete 12= ON ;

    274: WAIT DI[88:TaskCompAck 12]=ON ;

    275: ;


    283: ! Jump to the end of program ;

    284: JMP LBL[200] ;

    285: ;

    286: !-------------------------------- ;

    287: !Task Complete 13 ;

    288: !-------------------------------- ;



    I can set DO[88] on R1 and R2 and the cell takes off like it should.

    I can’t understand how DO[88] could be off when it is one line past the macro that sets it??? It is like the macro doesn’t execute?


    Anyone have any ideas what might be going on?


    Thanks.

  • Thanks for the reply.


    Line 72 from the program executing that runs the macro...


    72: SETCOMPLETE(12) ;

    73: WAIT (DI[12:B @ ROBOT]=ON AND DI[18:B @ Weld 2]=ON) ;

    74: DO[88:TaskComplete 12]=OFF ;


    The first few lines of the macro are... (I deleted all the comments and some of the other code to keep it brief)


    14: R[36]=AR[1] ;

    24: SELECT R[36]=1,JMP LBL[10] ;

    34: =11,JMP LBL[110] ;

    35: =12,JMP LBL[120] ;

    36: =13,JMP LBL[130] ;


    So yes, I don't see how it wouldn't get to LBL[120].


    I will try to a "call SETCOMPLETE(12)" and see if that works better than what I'm doing.

  • We had the same problem on Sync executions. The only remedy we fount to work was to add a short wait on the call code to make sure they all stayed in sync.

Advertising from our partners