TCP Standard Interface Commands

This topic introduces the TCP Standard Interface commands supported by the inline measurement system. The TCP Standard Interface commands are used to establish TCP communication between the robot and the inline measurement system.

Command Overview

Command name Calling sequence Required Description

Command 800: Switch Project

-

No

Used to switch projects in the Mech-Metrics.

Command 801: Start Measurement Task

Yes

Use the robot or external device to inform the Mech-Metrics to start measuring the new part, and send the part name, part SN, and other part information to Mech-Metrics.

Command 802: Run Feature Measurement

Yes

This command triggers the Mech-MSR project that corresponds to the to-be-measured feature to run. If you need to perform multiple measurements, call this command multiple times.

Command 803: Stop Measurement Task

Yes

Use the robot or an external device to inform the Mech-Metrics that the measurement ends and request the measurement result of the part.

Command 804: Import Part SN During Measurement

No

In some scenarios, the SN code of the part cannot be obtained at the beginning of measurement. For example, it needs to be scanned during measurement. This command is used to input the part ID during the measurement.

Command 805: Query Part Historical Data

No

Input the SN of part to allow the main interface of Mech-Metrics to display the data view of the part.

Command 701: Calibration

-

Yes

Used for robot calibration process control and status query. When calling the command, calibration status parameters are passed in to restart the calibration or add calibration points. The command returns the current calibration status, the flange pose of the next calibration point, and the joint positions.

The command transmission methods supported by the inline measurement system are shown in the figure below:

real relationship

The explanation is as follows:

  • You can choose to use either the robot or external devices (such as PLCs) as the client to send commands to the inline measurement system in HEX or ASCII format. Whether sent via the robot or external devices (such as PLCs), these commands have the same effect, allowing you to choose flexibly based on your actual needs.

  • In the following two scenarios, it is recommended to use external devices (such as PLCs) to send 804 or 805 commands to Mech-Metrics in ASCII format to simplify the process:

    • When the robot is performing feature measurement, to avoid interrupting its measurement process and ensure measurement continuity, it is preferable to have external devices (such as PLCs) send the 804 or 805 command instead of the robot.

    • In scenarios where multiple robots measure in parallel and it is unclear which robot will provide the part SN, it is recommended that an external device (such as a PLC) sends the 804 or 805 command for unified management.

Communication Commands

Command 800: Switch Project

Send Command

Sender

Robot or external device (such as a PLC)

Receiver

Mech-Metrics

Time to send

Before switching the project.

Command description

The robot or external device informs the Mech-Metrics to start switching projects.

Command Format

800, part ID, project ID

Sample command

800,1,1

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.
In the preceding example, the first 1 is the part ID.

Project ID

Yes

This parameter specifies the name of the project to be switched. The specified project ID must have been configured through project switching rules.
In the preceding example, the second 1 is the project ID.

Return Command

Sender

Mech-Metrics

Receiver

Robot or external device (such as a PLC)

Time to send

The sent command is received.

Command description

The Mech-Metrics informs the robot that it has received the command to switch to a new project, starts switching to the new project, and then informs the robot whether the switch was successful.

Command Format

800, status code

Sample command

800,8105

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8105.

  • If the status code returned by Mech-Metrics is not 8105, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8105, which indicates that the command execution succeeds.

Command 801: Start Measurement Task

Send Command

Sender

Robot or external device (such as a PLC)

Receiver

Mech-Metrics

Time to send

This command is sent when the measurement of a new part begins.

Command description

The robot or external device informs the Mech-Metrics to start measuring a new part.

Command Format

801, part ID, part name, part SN, quality inspection mode, custom 1, custom 2, custom 3, custom 4, custom 5, custom 6, custom 7, custom 8

Sample command

801,1,part01,sn001,2,1,2,3,4,5,6

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.

In the above example, the first 1 is the part ID.

Part name

Yes

This parameter specifies the name of the part to be measured. The part name can contain letters and digits and cannot exceed 20 characters in length.

In the above example, part01 is the part name.

part SN

Yes

This parameter specifies the part SN. The part SN, also known as the part serial number, is the unique identifier of the part. The part SN can contain letters and digits and cannot exceed 30 characters in length.

In the above example, sn001 is the part SN.

This parameter is required. In some scenarios, the part SN cannot be obtained at the start of measurement and may need to be obtained by scanning a barcode or QR code during the measurement process. In these cases, the part SN can be empty but the position of the part SN must be reserved.

Example: 801,1,part01,,1,2,3,4,5,6. In this example, the part SN is not specified but the position of the part SN is reserved by the comma (,).

qc mode

Yes

This parameter specifies the quality inspection mode of the part. 1: Full inspection, which is to detect all dimensions of the part; 2: Partial inspection, which is to detect key dimensions of the part. 0: Use the current configuration.

In the preceding example, the first 2 represents that the quality inspection mode is partial inspection.

custom 1-8

No

This parameter is optional. This parameter provides custom information of the part. Custom parameters are used only when more part information needs to be provided to Mech-Metrics. This command supports up to 8 custom parameters. The value of each custom parameter is an integer between 1 and 8.

To use a custom parameter:

  1. In the upper-part ribbon of Mech-Metrics, select Communication  Configure Communication Command to configure the meaning for values (1 to 8) of the custom parameter (such as custom parameter 1).

  2. Add the custom parameter to the command.

In the above example, 1,2,3,4,5,6 are custom parameters. The meaning of each of these custom parameters is configured in Mech-Metrics.

Return Command

Sender

Mech-Metrics

Receiver

Robot or external device (such as a PLC)

Time to send

The sent command is received.

Command description

Mech-Metrics informs the robot that it has received the start measurement task command, begins creating a historical record for the new part, and informs the robot whether this execution will be continuous or a single run.

Command Format

801, status code, loop execution/one-time execution

Sample command

801,8100,1

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8100.

  • If the status code returned by Mech-Metrics is not 8100, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8100, which indicates that the command execution succeeds.

loop execution/one-time execution

This parameter indicates whether the execution is loop execution or one-time execution.

  • 0: One-time execution. If one-time execution is specified, the robot runs the following commands in sequence: 801→802→803.

  • If you want to measure multiple features, please run Command 802 for multiple times. For example, if you want to measure two features, the robot runs the following commands in sequence: 801→802→802→803.

  • For more information about Command 802, see Command 802: Run Feature Measurement. For more information about Command 803, see Command 803: Stop Measurement Task.

  • 1: Loop execution. If loop-execution is specified, the robot executes multiple command sets. The command set starts from Command 801. If one-time execution is returned by a Command 801 in a command set, the robot program stops after the command set is executed.

In the above example, 1 indicates loop execution.

  • By default, Mech-Metrics returns 0 to the robot, indicating that the current execution is a one-time execution.

  • In semi-dynamic repeatability testing, Mech-Metrics returns 1 to the robot, indicating that the current execution is a loop-execution. Since manual movement of the robot or clamping of the part is not required during semi-dynamic repeatability testing, you can continuously execute multiple rounds of commands on the robot side.

Command 802: Run Feature Measurement

Send Command

Sender

Robot or external device (such as a PLC)

Receiver

Mech-Metrics

Time to send

The robot reaches the feature’s image-taking position.

Command description

This command triggers the Mech-MSR project that corresponds to the to-be-measured feature to run.

Command Format

802, part ID, feature ID, robot joint positions, robot flange pose

Sample command

802,1,1,10,20,30,40,50,60,100,200,300,0,180,0

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.

In the above example, the first 1 is the part ID.

feature ID

Yes

This parameter specifies the ID of the feature to be measured. The ID is the unique identifier of the feature. The ID is an integer between 1 and 999.

Feature ID is an integer used to uniquely identify the feature in the software. The value range is 1 to 999.

In the above example, the second 1 is the feature ID.

robot joint positions

Yes

This parameter specifies the joint positions of the robot. In general, six joint positions (J1 to J6) of the robot are specified. Unit: degrees.

In the above example, 10,20,30,40,50,60 are the joint positions of the robot.

robot flange pose

Yes

This parameter specifies the pose of the robot flange. It typically includes six values: three for position and three for orientation. The unit of position data is millimeters. The orientation data is represented using Euler angles, with the unit in degrees.

In the example above, 100,200,300,0,180,0 represent the robot flange pose, where 100,200,300 are position data, and 0,180,0 are orientation data.

Return Command

Sender

Mech-Metrics

Receiver

Robot or external device (such as a PLC)

Time to send

Mech-Metrics receives a signal indicating that the camera has completed taking the photo.

Command description

Notify the robot that the image has been taken, so it can move to the next measurement position.

Command Format

802, status code

Sample command

802,8101

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8101.

  • If the status code returned by Mech-Metrics is not 8101, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8101, which indicates that the command execution succeeds.

Command 803: Stop Measurement Task

Send Command

Sender

Robot or external device (such as a PLC)

Receiver

Mech-Metrics

Time to send

The last feature of the part has been photographed. The measurement of the part has been completed.

Command description

Use the robot or an external device to inform the Mech-Metrics that the measurement ends and request the measurement result of the part.

Command Format

803 Part ID

Sample command

803,1

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.

In the above example, 1 is the part ID.

Return Command

Sender

Mech-Metrics

Receiver

Robot

Time to send

The sent command is received.

Command description

Return the measurement result.

Command Format

803, status code, result, part status 1, part status 2, part status 3

Sample command

803,8102,0,0,0,0

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8102.

  • If the status code returned by Mech-Metrics is not 8102, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8102, which indicates that the command execution succeeds.

part judgment result

This parameter indicates the result of the part.

  • 0 indicates OK (the part is qualified).

  • 1 indicates NG (the part is defective).

  • 2 indicates no data.

In the above example, the first 0 indicates that the part is qualified.

part status 1-3

These parameters represent the number of measurement items that exceed the first, second, and third tolerance zones.

  • If a specific-level tolerance is not set or the measured value of the item is within the tolerance, 0 is displayed.

  • If a specific-level tolerance is set and the measured value of the item exceeds the tolerance, the number increases by 1.

In the example above, the last three 0s indicate that no tolerances are set, or no measurement values have exceeded the tolerances.

Command 804: Import Part SN During Measurement

Send Command

Sender

Robot or external device (such as PLC)

When do the robot and external devices each send the 804 command?

  • When the robot is performing feature measurement, to avoid interrupting its measurement process and ensure measurement continuity, it is recommended that the 804 command be sent to Mech-Metrics by an external device instead of the robot.

  • In scenarios where multiple robots perform measurements in parallel, since it is unclear which robot provides the part SN, it is recommended that an external device send the 804 command to Mech-Metrics for unified management.

Receiver

Mech-Metrics

Time to send

The command can be sent at any point during the current part measurement process.

Command description

In some scenarios, the part ID (also known as part SN) cannot be obtained at the start of measurement and may need to be obtained by scanning a barcode or QR code during the measurement process. This command is used to input the part ID during the measurement.

Command Format

804, part ID, part SN

Sample command

804,1,sn001

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.

In the above example, 1 is the part ID.

part SN

Yes

This parameter specifies the part SN. The part SN, also known as the part serial number, is the unique identifier of the part. The part SN can contain letters and digits and cannot exceed 30 characters in length.

In the above example, sn001 is the part SN.

Return Command

Sender

Mech-Metrics

Receiver

Robot or external device (such as PLC)

Time to send

The sent command is received.

Command description

Inform the robot that the part SN has been successfully input.

Command Format

804, status code

Sample command

804,8103

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8103.

  • If the status code returned by Mech-Metrics is not 8103, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8103, which indicates that the command execution succeeds.

Command 805: Query Part Historical Data

Send Command

Sender

Robot or external device (such as PLC)

When do the robot and external devices each send the 805 command?

  • When a robot performs feature measurement, to avoid interrupting its measurement process and ensure continuity, you can choose to have an external device, rather than the robot, send the 805 command to Mech-Metrics.

  • In scenarios where multiple robots perform measurements in parallel, since it is unclear which robot provides the part SN, it is recommended that an external device send the 805 command to Mech-Metrics for unified management.

Receiver

Mech-Metrics

Time to send

The command can be sent at any point when the measurement is not started.

Command description

Input a part SN to allow Mech-Metrics to display the input part in the main interface.

Command Format

805, part ID, part SN

Sample command

805,1,sn001

Command parameter description

Parameter Required Description

Part ID

Yes

This parameter specifies the unique identification of the part type. The part ID is an integer between 1 and 99. The specified part ID must have been configured in the Configure Part ID window.

In the above example, 1 is the part ID.

part SN

Yes

This parameter specifies the part SN. The part SN, also known as the part serial number, is the unique identifier of the part. The part SN can contain letters and digits and cannot exceed 30 characters in length.

In the above example, sn001 is the part SN.

Return Command

Sender

Mech-Metrics

Receiver

Robot or external device (such as PLC)

Time to send

The sent command is received.

Command description

Inform that the part SN has been successfully input.

Command Format

805, status code

Sample command

805,8104

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 8104.

  • If the status code returned by Mech-Metrics is not 8104, the command fails to be run. For troubleshooting details, see Troubleshooting.

In the above example, the status code returned by Mech-Metrics is 8104, which indicates that the command execution succeeds.

Command 701: Calibration

Send Command

Sender

Robot

Receiver

Mech-MSR

Time to send

When hand-eye calibration is required.

Command description

The robot tells the Mech-MSR to start hand-eye calibration. This command needs to be used in conjunction with the 3D Camera Calibration tool in the Camera menu bar of Mech-MSR.

Command Format

701, calibration status, robot flange pose, robot joint positions

Sample command

701,0,100,200,300,0,180,0,10,20,30,40,50,60

Command parameter description

Parameter Required Description

Calibration status

Yes

This parameter specifies the current calibration status.

  • 0: Notify the Mech-MSR to initiate the calibration.

  • 1: The robot has reached the previous calibration point.

  • 2: The robot failed to reach the previous calibration point.

Flange Pose

Yes

The current flange pose of the robot. It typically includes six values: three for position and three for orientation. The unit of position data is millimeters. The orientation data is represented using Euler angles, with the unit in degrees.
In the example above, 100,200,300,0,180,0 represent the robot flange pose, where 100,200,300 are position data, and 0,180,0 are orientation data.

Joint Positions (JPs)

Yes

This parameter specifies the joint positions of the robot. In general, six joint positions (J1 to J6) of the robot are specified. Unit: degrees.
In the above example, 10,20,30,40,50,60 are the joint positions of the robot.

Return Command

Sender

Mech-MSR

Receiver

Robot

Time to send

The sent command is received.

Command description

The Mech-MSR informs the robot that it has received a command to re-calibrate or add a calibration point, starts executing the command, and informs the robot whether this execution is successful.

Command Format

701, status code, calibration status, flange pose of next calibration point, joint positions of next calibration point

Sample command

701,7100,0,100,200,300,0,180,0,10,20,30,40,50,60

Command parameter description

Parameter Description

status code

This parameter indicates the status code that indicates the command execution result.

  • If the command is executed successfully, Mech-Metrics will return status code 7100 or 7101.

  • If the status code returned by Mech-Metrics is not 7100 or 7101, the command fails to be run. For troubleshooting details, see Troubleshooting.

Calibration status

This parameter represents the execution status of the calibration command.

  • 0: In the process of calibration.

  • 1: Calibration is finished.

Flange pose of next calibration point

The flange pose of the next calibration point that the robot is supposed to move to.
In the above example, 100,200,300,0,180,0 represents the robot flange pose, where 100,200,300 are position data, and 0,180,0 are orientation data.

Joint positions of next calibration point

The joint positions of the next calibration point that the robot is supposed to move to.
In the preceding example, 10, 20, 30, 40, 50, 60 are the joint positions of the next calibration point to which the robot will move.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.