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

In the OnRobot RG2 user manual  you can find what variables you can use for the grippers in script code (Plus lots more):

Feedback Variable Description
grip_detected True/False True if Gripper has detected a work piece
lost_grip True/False True if Gripper has dropped a work piece
measure_width [mm] Width between the fingers of the Gripper

But yes, you have to add them as script code, as the variables will not be loaded until you run it.
So an example where the RG(0) loads the variables and you can then use it in the If:

  • Robot Program
    • MoveJ
      • Waypoint_Safe
      • Waypoint_Enter_Pick
    • RG2(0)
    • If grip_detected == True
      • MoveJ
        • Waypoint_Exit_Pick
    • Else
      • RG2(85)
      • MoveJ
        • Waypoint_Safe