Setting up modbus for ur5e + rg2 gripper

Hi all,
First to say that I’m TOTAL noob in robotics and ROS so dont blame me fro questions that I will ask here.
I work on project that includes ur5e arm and onrobot rg2 v2 gripper that is connected to arm over quick changer (rs485). Ur5e is connected to controller box (not compute box) and controller box is connected to ubuntu pc over ethernet cable. I have successfully connected arm with pc and I can control it over ROS with python scripts. My problem is to control gripper from ROS and how I see the best way is to establish connection over modbus.

My question is - how to setup modbus on teach pendant (how to setup inputs, outputs,registers…). I just need to open and close gripper from python script.

Any help will be much appreciated.