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.
David_Gariepy

@jcontreras
Here is an example of an assembly using 2 different parts.  
In this example, I use 4 differents variables, 2 for each part. 
1 to keep track of the number of attempts, and 1 to define if the part has been found or not. 
In the before start of the program, i initialized these variables. 

My first camera locate is in an if statement.
If the number of attempts is below 3, and the part hasn't been found, the camera will take the first picture. if it find the part, it will set the variable to True, otherwise, it will continue the program and update the number of attempts +1

The second camera locate is also in an if statement 
If the first part has been found, and the second hasn't yet, and the number of attempts to find that part is below 3, then take a picture.
if it find the part, it will set the variable part2_found to True, otherwise, it will continue the program and update the number of attempts +1

 Program
   BeforeStart
     part1_attempts≔0
     part1_found≔ False 
     part_2_attempts≔0
     part2_found≔ False 
   Robot Program
     MoveJ
       Snapshot_pos1
     If part1_attempts<3 and part1_found≟ False 
       Camera Locate
         MoveJ
           'pick and place'
         part1_found≔ True 
       part1_attempts≔part1_attempts+1
     If (part1_found≟ True ) and (part2_found≟ False ) and (part_2_attempts<3)
       Camera Locate
         MoveJ
           'pick and place'
         part2_found≔ True 
     If part1_found≟ True  and part2_found≟ True 
       'Program is finished, reset variables'
       part1_attempts≔0
       part1_found≔ False 
       part_2_attempts≔0
       part2_found≔ False 
     Else
       'part not found, do something else'
     sync()