You have to send functions' definitions it is not possible to call rq_activate_and_wait without defining this function.
Check those articles for details:
https://dof.robotiq.com/discussion/1649/control-gripper-via-ur-controller-client-interface#latest
https://dof.robotiq.com/discussion/1987/how-to-control-robotiq-product-through-port-30002-on-universal-robot
def myProg():
movel(p[0.27866, -0.52951, 0.60609, -2.955, 0.96807, -0.02971], a=1.2, v=1, t=0, r=0)
end
However, I'm trying to do the same thing (send URScripts over UDP) for the gripper commands, and they do not seem to work. For example, sending the following over a UDP connection results in no motion:
def myProg():
rq_activate_and_wait()
rq_move_and_wait(1)
end