Skip to content

8. Appendix - UFACTORY Private TCP Control

Modbus TCP is an application-layer messaging protocol with three frame types: ASCII, RTU, and TCP. Standard Modbus interfaces include RS232, RS422, RS485, and Ethernet, using master/slave communication.

Gripper G2 uses the UFACTORY Private TCP protocol, which is similar to but not identical with standard Modbus TCP.

Private TCP communication process:

  1. Establish TCP connection
  2. Prepare Private TCP message
  3. Send message using send command
  4. Wait for response on same connection
  5. Read response using recv command to complete data exchange
  6. Close TCP connection when communication task ends

Parameters: Default TCP port: 502
Protocol ID: 0x00 0x02 (control - currently only this ID)
All data parsing in this section uses big-endian format.

8.1 Read Registers

Read Registers
Request Format
Modbus TCP HeaderTransaction ID2 Bytes0x00, 0x01
Protocol ID2 Bytes0x00, 0x02
Length2 Bytes0x00, 0x08
Register1 Byte0x7C
ParametersStatus1 Byte0x00
Internal UseHost ID1 Byte0x09
Modbus RTU DataGripper ID1 Byte0x08
Function Code1 Byte0x03
Start Address2 BytesAddress
Register Count2 BytesN*
Response Format
Modbus TCP HeaderTransaction ID2 Bytes0x00, 0x01
Protocol ID2 Bytes0x00, 0x02
Length2 Bytes6+N*x2
Register1 Byte0x7C
Status1 Byte0x00
Internal UseHost ID1 Byte0x09
Modbus RTU DataGripper ID1 Byte0x08
Function Code1 Byte0x03
Byte Count1 ByteN*x2
Register ValuesNx2 BytesValue

Note: N* = Register count

8.2 Write Registers

Write Registers
Request Format
Modbus TCP HeaderTransaction ID2 Bytes0x00, 0x01
Protocol ID2 Bytes0x00, 0x02
Length2 Bytes9+Nx2
Register1 Byte0x7C
Internal UseHost ID1 Byte0x09
Modbus RTU DataGripper ID1 Byte0x08
Function Code1 Byte0x10
Start Address2 BytesAddress
Register Count2 BytesN*
Byte Count1 ByteN*x2
Register ValuesN*x2 BytesValue
Response Format
Modbus TCP HeaderTransaction ID2 Bytes0x00, 0x01
Protocol ID2 Bytes0x00, 0x02
Length2 Bytes0x00, 0x09
Register1 Byte0x7C
ParametersStatus1 Byte0x00
Internal UseHost ID1 Byte0x09
Modbus RTU DataGripper ID1 Byte0x08
Function Code1 Byte0x10
Start Address2 BytesAddress
Register Count2 BytesN*

8.3 Private TCP Examples

  1. Enable gripper. Address (0x0100)
Tx: 00 01 00 02 00 0B 7C 09 08 10 01 00 00 01 02 00 01
Rx: 00 01 00 02 00 09 7C 00 09 08 10 01 00 00 01
  1. Set gripper position to 400. Address (0x0700)
Tx: 00 01 00 02 00 0D 7C 09 08 10 07 00 00 02 04 00 00 01 90
Rx: 00 01 00 02 00 09 7C 00 09 08 10 07 00 00 02
  1. Read error code. Address (0x000F)
Tx: 00 01 00 02 00 08 7C 09 08 03 00 0F 00 01
Rx: 00 01 00 02 00 08 7C 30 09 08 03 02 00 00
  1. Set gripper enable, position(850), speed(3000), force(50). Address (0x0Cxx)
Tx: 00 01 00 02 00 11 7C 09 08 10 0C 00 00 05 0A 00 01 0B B8 00 32 03 52
Rx: 00 01 00 02 00 09 7C 30 09 08 10 0C 00 00 05