Have you thought about monitoring the force when picking the part? You could use the built in force monitoring or use a FT sensor from one of several companies including Robotiq, ATI and Optoforce? This would prevent the robot from going into a protective stop by limiting the amount of force that it pulls with and thereby allowing the robot to keep waiting until the force is low enough to get the wire off the bobbin.
TL;DR: Occasionally work pieces are stuck and robot does a protective stop. Need to adjust variable when this happens. How?
I run a UR10 for unloading copper coils from a winding machine. The coils are wound around a bobbin and then heated with electric current to bond the wires together. The problem is that the heat-activated bonding agent also tends to glue the coil to the bobbin and this adhesion only gets stronger when production cycles count up ie. the first coil of the batch can be removed immediately, while the n'th coil might take five minutes of air cooling for it to pop loose.
I run a pallet stacking routine on the robot to seek the coil on the bobbin and then perform a 50mm move on the X-axis to get the coil off the bobbin. While the robot does the unloading, I run a timer on the background to increase or decrease the delay for the unloading, so that the robot adjusts its own cycle timer to the proper minimum. Sometimes it takes a while to get the coil off the bobbin, so the robot increases the delay and thus the cooling time of the coil before it goes to pick up the coil.
But the problem comes when the coil is slightly too stuck and the robot stops on a protective stop. It might take 10 seconds more for the coil to actually loosen, so usually the robot just picks up where it left when the operator enables it and happily runs the routine through. During the P-Stop the delay-adjustment timer does not run, so the robot gets stuck again on the next cycle because it never crosses the "increase delay" timer threshold and so on and so on.
So how can I perform an action when the robot is stopped by a P-Stop? I want to reset the delay timer to a safe (high) value whenever the robot stops instead of changing the variable value by hand.