RobotStudio event

TRAP routine start is delayed

Hi, I want the TRAP routine to start right after TriggL instruction. But I don't want to change z50 to fine or use Waittime instruction.
Is it possible to do something?

        ...
        TriggCheckIO Trig_Vac1_Check,0,di_Vac1_1,EQ,1\StopMove,VacInterrupt;
        TriggL pAboveConv,v300,Trig_Vac1_Check,z50,VacuumGrip;

        !TRAP routine must start here!
        IF bricks_in_frame=1 OR THEN
            DropWObj wobj_cnv1;
            TPWrite "Rob1 dropped wobj";
        ENDIF

        IF Rob1_Pick_Int=FALSE THEN
            !TRAP routine starting here in fact!
            WaitSyncTask\InPos,Rob1_Ready,task_list;
            TPWrite "ROB1 WaitSyncTask";
        ENDIF

Comments

  • IF bricks_in_frame=1 OR THEN
                DropWObj wobj_cnv1;
                TPWrite "Rob1 dropped wobj";
            ENDIF

    OR what?  This seems incomplete.
    Lee Justice
  • lemster68 said:
    IF bricks_in_frame=1 OR THEN
                DropWObj wobj_cnv1;
                TPWrite "Rob1 dropped wobj";
            ENDIF

    OR what?  This seems incomplete.
    I just deleted all unnecessary fragments of code to make it more readable. There was another condition. I forgot to delete "OR"...
  • Check out ISignalDO in the RAPID instruction manual.
    ...

    CONNECT sig1int WITH iroutine1;
    ISignalDO do_ForceTrap, 1, sig1int;

     IF Rob1_Pick_Int=FALSE THEN
                !TRAP routine starting here in fact!
                Set do_ForceTrap
                WaitSyncTask\InPos,Rob1_Ready,task_list;
                TPWrite "ROB1 WaitSyncTask";
            ENDIF
  • So the reason why I asked is this:  put a WaitUntil condition 1 OR condition 2 OR condition 3 first.
    Lee Justice
  • SomeTekk
    SomeTekk
    edited August 2019
    I need to review MORE closely (especially cutting and pasting) before posting and heading away.

    Trying again.  :|

    PROC InitTrap()
    IDelete sig1int;
    CONNECT sig1int WITH iroutine1;
    ISignalDO do_ForceTrap, 1, sig1int;
    ENDPROC

    +++++++++++++++++++++++++++++++++++++++++
     ...

    InitTrap;

    ...

     !TRAP routine must start here!
         Set do_ForceTrap;

            IF bricks_in_frame=1 OR THEN
                DropWObj wobj_cnv1;
                TPWrite "Rob1 dropped wobj";
            ENDIF

            IF Rob1_Pick_Int=FALSE THEN
                !TRAP routine starting here in fact!
                WaitSyncTask\InPos,Rob1_Ready,task_list;
                TPWrite "ROB1 WaitSyncTask";
            ENDIF
  • egor
    egor
    edited August 2019
    SomeTekk, thanks for you advice! I found my own way, using second trigger <Trig_Pos_Reached>, which is checked position. If position has not been reached, the program pointer doesn't move further:

            IDelete VacInt;
            CONNECT VacInt WITH TrapPick;
            ...
            !Turning on vacuum before pick position
            TriggIO Trig_Vac_ON,0\Start\DOp:=do_Valve_Rob1_1_on,1;
            TriggL RelTool(RelTool(Offs(pPick,x_brick+26,y_brick,z_brick),0,0,0\Rz:=rot_z_brick+flip_rot_R1),0,0,0\Rx:=tilt_x_brick\Ry:=tilt_y_brick),
    v100,Trig_Vac_ON,z0\Inpos:=fllwtime0_5,VacuumGrip\WObj:=wobj_cnv1;
            !Pick position
            MoveL RelTool(RelTool(Offs(pPick,x_brick+26,y_brick,z_brick+50),0,0,0\Rz:=rot_z_brick+flip_rot_R1),0,0,0\Rx:=tilt_x_brick\Ry:=tilt_y_brick),
    v150,z10,VacuumGrip\WObj:=wobj_cnv1;
            !Check vacuum
            TriggCheckIO Trig_Vac_Check,0,di_Vac1_1,EQ,1\StopMove,VacInt;
            !The signal <do_PosReached> is set to 1 when point "pAboveConv" is reached
            TriggIO Trig_Pos_Reached,0\DOp:=do_PosReached,1;
            TriggL pAboveConv,v300,Trig_Vac_Check\T2:=Trig_Pos_Reached,z50,VacuumGrip;
            !If do_PosReached = 0 it is mean that TRAP routine will run. 
            WaitDO do_PosReached,1;
            SetDO do_PosReached,0;

            !TRAP routine is running here

            IF Rob1_PickInt=FALSE THEN
                IF bricks_in_frame=1 THEN
                    DropWObj wobj_cnv1;
                    TPWrite "Rob1 dropped wobj";
                ENDIF

                WaitSyncTask\InPos,Rob1_Ready,task_list;
                TPWrite "ROB1 WaitSyncTask";
            ENDIF