Skip to content

8.Appendix-UFACTORY Private TCP protocol control

This section mainly explains how to control the BIO Gripper G2 by using the Modbus-TCP protocol through xArm control box.

8.1 UFACTORY Private TCP protocol

8.1.1 Register Address Description

Refer to 4.Modbus-RTU Communication Protocol Control

Modbus-TCP:

Modbus protocol is an application layer message transmission protocol, including three message types: ASCII, RTU, and TCP. The standard Modbus protocol physical layer interface includes RS232, RS422, RS485 and Ethernet interfaces, and adopts master / slave communication.

The BIO Gripper G2 supports the private TCP protocol, which is similar but not identical to the standard Modbus TCP.

Private Modbus TCP Communication Process:

  1. Establish a TCP connection
  2. Prepare Modbus messages
  3. Use the send command to send a message
  4. Wait for a response under the same connection
  5. Use the recv command to read the message and complete a data exchange
  6. When the communication task ends, close the TCP connection

Parameter:

  • Default TCP Port: 502
  • Protocol: 0x00 0x02

On the problem of users using communication protocols to organize data in big endian and little endian:

In this article, data analysis is big-endian analysis.

8.1.2 Read BIO Gripper Register

Register Function

Read Register
Request
MBTP HeaderTransaction Identifier2 Bytes0x0001
Protocol Identifier2 Bytes0x0002
Length2 Bytes6+N*x2
Unit Identifier1 Byte0x7C
Internal UseInternal Use1 Byte0x09
Modbus RTU DataSlave ID (Gripper)1 Byte0x08
Function Code1 Byte0x03
Register Starting Address2 BytesAddress
Quantity of RegistersN*x2 BytesN*
Response
MBTP HeaderTransaction Identifier2 Bytes0x0001
Protocol Identifier2 Bytes0x0002
Length2 Bytes6+N*x2
Unit Identifier1 Byte0x7C
Status Value1 Byte0x00
Internal UseInternal Use1 Byte0x09
Modbus RTU DataSlave ID1 Byte0x08
Function Code1 Byte0x03
Byte Count1 ByteN*x2
Registers ValueN*x2 BytesValue

N* = Quantity of Registers

Address = Register Starting Address

Register Function

Resgister Starting AddressRegisters Value
Get Gripper status Register0x00002 BytesDisabled: 0x0000 Enabling: 0x0004 Enabling completed: 0x0008 Stop status: 0x0008 Motion status: 0x0009 Clipping status: 0x000A Error status: 0x000B
Get Gripper Error Register0x000F2 BytesAn error occurs: all other return values indicate an error(except 0)No error occurred: 0x0000

8.1.3 Write BIO Gripper Register

Write Register
Request
MBTP HeaderTransaction Identifier2 Bytes0x0001
Protocol Identifier2 Bytes0x0002
Length2 Bytes9+N*x2
Unit Identifier1 Byte0x7C
Internal UseInternal Use1 Byte0x09
Modbus RTU DataSlave ID (Gripper)1 Byte0x08
Function Code1 Byte0x10
Register Starting Address2 BytesAddress
Quantity of Registers2 BytesN*
Byte Count1 ByteN*x2
Registers ValueN*x2 BytesValue
Response
MBTP HeaderTransaction Identifier2 Bytes0x0001
Protocol Identifier2 Bytes0x0002
Length2 Bytes0x0009
Unit Identifier1 Byte0x7C
Status Value1 Byte0x00
Internal UseInternal Use1 Byte0x09
Modbus RTU DataSlave ID1 Byte0x08
Function Code1 Byte0x10
Register Starting Address2 BytesAddress
Quantity of Registers2 BytesN*

N* = Quantity of Registers

Address = Register Starting Address

Resgister:

Resgister Starting AddressRegister Value
Enable/Disable Gripper Register0x01002 BytesEnable : 0x0001 Disable : 0x0000
Set Gripper Position Register0x07004 BytesOpen the Gripper : 0x0000 0x0082 Close the Gripper : 0x0000 0x0032
Set Gripper Speed Register0x03032 Bytes0x0000-0x0BB8
Clear Error Register0x000F2 Bytes0x0000

8.1.4 Private TCP Example

Use private TCP to control BIO Gripper G2 opening and closing, mode 0.

  1. Set the Bio Gripper G2 mode 0. Address: 0x010A, still effective after power failure.
Send:00 01 00 02 00 08 7C 09 08 06 11 0A 00 00
Response:00 01 00 02 00 09 7C 50 09 08 06 11 0A 00 00
  1. Enable the Gripper. Address: 0x0100
Send:00 01 00 02 00 0B 7C 09 08 10 01 00 00 01 02 00 01
Response:00 01 00 02 00 09 7C 50 09 08 10 01 00 00 01
  1. Open the Gripper
Mode 0 has no position control, sending position > 90, then opens the Bio Gripper G2. (OCT)130=(HEX)0082

Send:00 01 00 02 00 0d 7C 09 08 10 07 00 00 02 04 00 00 00 82
Response:00 01 00 02 00 09 7C 50 09 08 10 07 00 00 02
  1. Close the Gripper
Mode 0 has no position control and sends a position ≤ 90,then closes the Bio Gripper G2. (OCT)50=(HEX)0032

Send:00 01 00 02 00 0d 7C 09 08 10 07 00 00 02 04 00 00 00 32
Response:00 01 00 02 00 09 7C 50 09 08 10 07 00 00 02