Urscript for onrobot is not work

The commands for the gripper (like rg_grip) are not saved on the robot itself.
They are saved in the beginning of each robot program.
If you open the script file of a robot program (access it via ftp) that has a gripper command you will see a large section that implements the gripping functions.
If you send a program without this “boilerplate” code your calls to these functions cause errors.

What you need to do is send the boilerplate code as well.
You can see the solution for the onrobot rg2 grippers in this thread, however you will most likely need to adjust them for the RG6
gripper.

If you can send me the .script file of a program with gripper commands from the pendant I can tell you which parts of the code you need to extract and send with the rest of your program.