DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
Jason_g

Nickolas,

Attached is subprogram. Please not "monitoring expression continuously" is unchecked. 


Program
   Robot Program
     MoveJ
       pMidway
     If Nest1_Full<1  and  Rack1>0  and HoldingNest≟ False
       MoveJ
         pApproachNest1
         rq_move_and_wait(150)
         MoveL
           pDwnNest1
           rq_close_and_wait()
           CheckHoldNest≔ True
           Wait: 0.2
           CheckHoldNest≔ False
           Wait HoldingNest≟ True
           pUpNest1
           pUpNest1Ret
           pApproachNest1
           pMidway
           Rack1≔0
           Wait: 0.2
     If Nest2_Full<1  and Rack2>0  and HoldingNest≟ False
       MoveJ
         pApproachNest2
         rq_move_and_wait(150)
         MoveL
           pDwnNest2
           rq_close_and_wait()
           CheckHoldNest≔ True
           Wait: 0.2
           CheckHoldNest≔ False
           Wait HoldingNest≟ True
           pUpNest2
           pUpNest2Ret
           pApproachNest2
           Rack2≟0
           Wait: 0.2
     If Nest3_Full<1 and Rack3>0  and HoldingNest≟ False
       MoveJ
         pApproachNest3
         rq_move_and_wait(150)
         MoveL
           pDownNest3
           rq_close_and_wait()
           CheckHoldNest≔ True
           Wait: 0.2
           CheckHoldNest≔ False
           Wait HoldingNest≟ True
           pUpnest3
           pUpNest3Ret
           pApproachNest3
           Wait: 0.2
     sync()

Jason_g
Jason_g

@matthewd92                        

Its running a thread to obtain feedback from adaptive gripper:

    Thread_2
     If CheckHoldNest≟ True
       GripperPose≔rq_current_pos()
     If GripperPose>210  and  GripperPose<229
       HoldingNest≔ True
     Else
       HoldingNest≔ False    

Last night I revised to program to use Case statement in subroutines instead and its functioning just fine. I still don't know what was causing that though    

Switch PullRackSeq
       Case 1
         MoveJ
           pApproachNest1
           rq_move_and_wait(150)
           MoveL
             pDwnNest1
             rq_close_and_wait()
             CheckHoldNest≔ True
             Wait: 0.2
             CheckHoldNest≔ False
             Wait HoldingNest≟ True
             pUpNest1
             pUpNest1Ret
             pApproachNest1
             pMidway
             'Rack1≔0'
             Wait: 0.2
       Case 2
         MoveJ
           pApproachNest2
           rq_move_and_wait(150)
           MoveL
             pDwnNest2
             rq_close_and_wait()
             CheckHoldNest≔ True
             Wait: 0.2
             CheckHoldNest≔ False
             Wait HoldingNest≟ True
             pUpNest2
             pUpNest2Ret
             pApproachNest2
             'Rack2≟0 '
             Wait: 0.2

If you look at Case 2 notice I had script code "Rack2≟0". This should be an assignment as I was attempting to set flag. Realistically its not doing anything. I wouldn't think that would cause controller to disconnect or fault out?   

        

Jason_g
Jason_g

@matthewd92

If I comment out the Script code 'Rack2≟0 ' and replace with assignment 'Rack2=0" it runs just fine. When I flipflop it shuts down controller.

I tested this several times both ways and results remained cosistent

Jason_g

@Nicholas_Francoeur           

I was not aware I can call a subroutine from a subroutine. I needed to check gripper positions from subroutines after picking the part.


I will look at Grip Check node. I was unaware of this feature as well