Set Up Communication Between External Device and Mech-MSR via TCP ASCII

You are currently viewing the documentation for the latest version (2.2.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

About TCP ASCII

TCP ASCII is a communication mode based on TCP connections and ASCII string commands. It can be used for interaction between external devices such as PLCs and Mech-MSR. In this communication mode, the external device acts as the TCP client and Mech-MSR acts as the TCP server. After the connection is established, the external device can trigger a project to run and obtain data such as judgment results and measurement results by sending string commands.

This communication mode is simple to configure and easy to debug. It is suitable for scenarios in which string commands are used to control project execution or read results. Before you read the following content, make sure that the communication configuration has been completed in Mech-MSR.

Communication Workflow

Depending on the on-site control method, TCP ASCII communication can follow either of the following workflows:

Communication Workflow (Command-Based)

The workflow of TCP ASCII communication based on commands is shown in the figure below.

tcp workflow
  • In the above figure, the command name is separated from the parameter by the English comma (default value). If you need to use another delimiter in the actual project, set the string delimiter parameter in the Communication Configuration window.

  • In addition to the return command, the 3D measurement system also allows you to obtain measurement results with other commands. For details, refer to TCP ASCII Commands.

The workflow is as follows:

  1. A TCP client (such as a PLC) establishes a TCP connection with the 3D measurement system (Mech-MSR).

  2. The TCP client sends a trigger command to trigger the project to run.

  3. Mech-MSR returns the command status code. For example, if the project is triggered successfully, Mech-MSR returns 1.

  4. The TCP client sends a return command to obtain the measurement results. After Mech-MSR receives the command, it starts the countdown for 10 seconds.

  5. Mech-MSR returns results. For example, if the project is run successfully, Mech-MSR returns the measurement results. If the project has not finished running within 10 seconds, Mech-MSR returns the error code -3.

Communication Workflow (Command-Free)

The TCP ASCII communication mode enables the 3D measurement system (Mech-MSR) to automatically push results to the client such as a PLC after each project execution, without requiring the client to send a request command. This mode is suitable when the laser profiler is in the Continuous Acquisition Mode or when project execution is triggered through I/O terminals.

The workflow is as follows:

  1. When configuring TCP ASCII communication, select Auto-push Results.

  2. Set Data format of return commands. Mech-MSR will automatically push the results in the specified data format.

  3. (Optional) Configure the project execution conditions. For example, set Run on Image Update in the project toolbar.

  4. The TCP client establishes a communication connection with the 3D measurement system.

  5. After each project run, Mech-MSR automatically pushes the results to the client.


The next section, TCP ASCII Commands, describes the supported commands and how to interpret the returned results.

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.