IF ELSE & Smart Component

Armbross
Armbross Singapore
Hello, I want to use an if else statement in my Rapid for sch project, 
IF cablecollision=1 THEN
        SetDO PickCable,1;
        MoveL outUsbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        PulseDO PowSync;
        WaitTime 1;
        MoveL LiftusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        WaitTime 1;
        MoveL PickusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        SetDO PickCable,0;
        PulseDO ResetPow;
        WaitTime 1;
        MoveL PressusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        SetDO jerkoffB,1;
        WaitTime 1;
        PulseDO gripperopen;
        SetDO jerkoffB,0;
        WaitTime 2;
        MoveL LiftusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;  
          SetDO Failure,1;
        ELSEIF rj45collision=1 THEN
        dthRJ45;
        SetDO PickCable,1;
        MoveL outUsbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        PulseDO PowSync;
        WaitTime 1;
        MoveL LiftusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        WaitTime 1;
        MoveL PickusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        SetDO PickCable,0;
        PulseDO ResetPow;
        WaitTime 1;
        MoveL PressusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        SetDO jerkoffB,1;
        WaitTime 1;
        PulseDO gripperopen;
        SetDO jerkoffB,0;
        WaitTime 2;
        MoveL LiftusbB,v1000,fine,GripperTCP\WObj:=wobj_cellArea;
        SetDO Failure,1;
        ELSE
        RJ45;
        dthRJ45;
        dthusbB;
        ENDIF

I'm trying to get the simulation to run the part where cablecollision=1 or rj45collision=1. But have been unable to change the value.

The two signals would also run posemover I made in smart component using collision sensor and latching. https://gofile.io/d/Kt7vIU (Thnks for help in adv)


Comments

Sign In or Register to comment.