Modbus (RTU / TCP)
Modbus(RTU / TCP)AdvancedA request-and-reply protocol that is a de facto standard for industrial devices; many electric grippers and some dexterous hands take commands through it.
Modbus is a communication protocol Modicon published in 1979, originally designed for PLCs; it later became the de facto common language of industrial devices and is now maintained by the Modbus Organization. It works strictly by request and reply: a master (the client, in newer terminology) sends a request, and a slave (the server) only answers and never speaks first. A device's data is laid out as numbered coils and registers, and each request carries a function code saying what to do — 03 reads holding registers, 06 writes a single register, 16 writes several. There are two common flavors. Modbus RTU runs over a serial line, usually RS-485, with the slave address and a CRC checksum in every frame and up to 247 slaves on one bus. Modbus TCP runs over Ethernet, on port 502 by default, and drops the CRC because the TCP/IP layers underneath already check the data. In embodied AI, the Robotiq 2F-85 gripper and the Inspire RH56 dexterous hand can both be controlled with Modbus RTU over RS-485. It is simple and universal, but polling devices one by one over a slow serial line limits speed, so high-rate joint motor loops usually run on CAN or EtherCAT instead.
ExampleConnect a Robotiq 2F-85 to a PC with a USB-to-RS-485 cable and, following the manual, set 115200 bps, 8 data bits, no parity, 1 stop bit and slave ID 9. Write the action, target position, speed and force to the registers starting at 1000 with function code 16, then read the registers starting at 2000 with function code 03 to get the gripper status, whether it has caught an object, and the finger position.
- Also called
- Modbus RTU, Modbus TCP, Modbus/TCP
- Related
- RS-485 · Programmable Logic Controller (PLC) · Robotiq 2F-85 Gripper · Inspire RH56 Dexterous Hand · Controller Area Network (CAN) · Serial Port (UART / USB-to-Serial)
- Sources
- Modbus - Wikipedia
Robotiq 2F-85 & 2F-140 Instruction Manual: 4. Control (4.7 Modbus RTU Communication)
Inspire Robots: The Dexterous Hand RH56 Series User Manual (2.3 Summary of MODBUS protocol)