Home› Programming
Discussion
Back to discussions page
bcastets
Vacuum Beta tester Posts: 609 Expert
Control gripper using python and Modbus TCP |
1.6K views
|
Answered | |
/ Most recent by learningrobot
in Programming
|
20 comments |

in Programming
You may be interested in controlling from your PC Robotiq grippers (2F85, 2F140, Hand-e, ePick, airPick,...) using modbusTCP, Python and Robotiq universal controller.
I made a sample program which activate the gripper. I would like to share it with you.
I hope it will help in your projects !
For more details about how to control Robotiq gripper by reading and writing its memory registers, I recommend to check the user manual.
I made a sample program which activate the gripper. I would like to share it with you.
I hope it will help in your projects !
For more details about how to control Robotiq gripper by reading and writing its memory registers, I recommend to check the user manual.
The program make a automatic grip followed by an automatic release.
The user manual of ePick remain the best source of information to make this kind of control.
somehow I still cannot get the code to work, I use the robot’s IP address but I am reading just none from the register. If I delete the earlier print output part, I will be able to reach further and print out gripper status and gripper control, but the gripper itself doesn’t respond.
I wonder whether this has anything to do with the fact that the gripper is connected to the wrist cable ? Should it be a different port then? I also tried to use a random ip but this time even printing gripper status and gripper control fails, so the IP address should be right.
Any help will be greatly appreciated !
Can you describe the connection between the gripper and the pc ?
Also give ip of your pc ?
I imagine python code running on the controller should be able to controller gripper over modbus rtu.
This post is about communicating with a robotiq gripper in modbus TCP. It involve the use of a universal controller.
I suppose that in your case you don't use a universal controller and have the gripper directly connected on your PC and try to communicate in Modbus RTU.
You can check the following article to learn how to do that:
https://dof.robotiq.com/discussion/1382/control-grippers-from-python-using-modbus-rtu#latest
When I run the code it says Module error: Cannot find 'PyModbus TCP'. your help would be appreciated. Thank you
pyModbusTCP is a python library that you need to install to be able to run this script.
https://pypi.org/project/pyModbusTCP/
You can PIP install it:
I was able to open and close the gripper using the activation gripper python code, thank you.
I have another question, how can I edit the code to close the gripper and not open it immediately?
Thank you for your time.
This sample code activate the gripper. It is not a simple closing and opening.
The gripper activation is necessary before doing any action with the gripper. During activation the gripper check what is its maximum and minimum opening position.
To control the gripper, you need to read and write its modbus registers. Please check the section control of the manaul to learn more about modbus registers and gripper control.
https://assets.robotiq.com/website-assets/support_documents/document/2F-85_2F-140_General_PDF_20200211.pdf
In your sample, what is the driver for the gripper? Was it on Ubuntu or Windows? Is the code still working?
I tried to follow the ROS library at http://wiki.ros.org/robotiq, but failed at Modbus TCP installation, as it said "Rosdep cannot find all required resouces of robotiq_modbus_tcp. How to configure it btw?
Thanks,