# URScript gripper control

:::{activity} Integrating gripper control
1. Run the following gripper code on the physical robots.
1. Analyze `rg_grip`. What does it do?
1. Modify it so that you can pick a place from the board and place it somewhere else.
1. Optional: Integrate the code to your existing project.
:::


:::{literalinclude} ../code/gripper-example.script
:::

:::{warning}
The code above does not work in the robot simulator, because it uses remote functions for the gripper which are not available in the simulator.
:::

::::{card} Troubleshooting
:::{card}
Symptom:
- Gripper does not move, even the status LED beside the gripper is green 🟢.

Explanation:
- The gripper's IP address in URScript may be wrong. 

Solution:
- Check its RPC address. On some robots, the gripper is connected to a separate control box, which address will be different than `localhost`.
:::
:::{card}
Symptom:
- Gripper does not move and the status LED beside the gripper is blinking 🔴.

Explanation:
- Probably gripper's safety function was triggered, because an usual force was applied on the gripper.

Solution:
- Reset the gripper's safety trigger using the pendant. Create a new robot program on the pendant and add a gripper block. In the gripper block you will see a setting that can reset the security trigger. Then the gripper LED should turn green again.
:::

::::