Quick Guide to Communication Configuration
This section introduces the operations related to communication configuration.
After completing the communication configuration and enabling the communication service, you can trigger the Mech-MSR project to run and obtain measurement results with external devices (such as PLC).
The Mech-Mind 3D Measurement System supports TCP ASCII communication with external devices.
Configure TCP ASCII Communication
Follow these steps to configure TCP ASCII communication:
-
On the toolbar of Mech-MSR, click Communication Configuration.
-
(Optional) In the Communication Configuration window, set the Port parameter as required.
The default value of the Port parameter is 5000. After the TCP ASCII communication service is enabled, the software listens to TCP ASCII commands sent by external devices at the specified port.
-
(Optional) Set the Data format of return commands parameter by referring to Set Data Format of Return Commands.
The Data format of return commands parameter is used to customize the format of the data returned by the software to the return commands.
-
(Optional) Set other data formats by referring to Set Other Data Format.
-
(Optional) Select the Auto-enable the service option according to your actual needs. If the option is selected, the software automatically enables the TCP ASCII communication service every time the software is started.
-
Click to start the TCP ASCII communication service.
After the TCP ASCII communication service is started successfully, the status of TCP ASCII is displayed as “Running.”
The previous procedure can also be used to modify the configuration of TCP ASCII communication. Note that the current communication configuration modification only takes effect for subsequent command requests. |
Set Data Format of Return Commands
The Data format of return commands parameter is used to customize the format of the data returned by the software to the return commands.
Format Description
The returned data for the “return” command supports the following fields:
Field | Description |
---|---|
%time |
Outputs image acquisition time in the format of 202001010101100 (01:01:01 sec, 100 ms, 01/01/2020). |
%judge |
Outputs the overall quality judgment result of the project. 0 is OK, and 1 is NG. |
%value[#] |
Outputs the measured value of the specified measurement item. “#” should be replaced with the ID of the specific measurement item. If it is set to 1, the measured value of the measurement item with an ID of 1 in the Communication output tab will be output. |
%value[%id] |
Outputs the measured values of all configured measurement items in the Communication output tab. |
%judge[#] |
Outputs the judgment result of the specified measurement item. 0 is OK, and 1 is NG. “#” should be replaced with the ID of the specific measurement item. If it is set to 1, the judgment result of the measurement item with an ID of 1 in the Communication output tab will be output. |
%judge[%id] |
Outputs the judgment results of all configured measurement items in the Communication output tab. |
Setting Example
Suppose that the Communication output tab contains three measurement items, whose IDs are 1, 2, and 3.
Example 1 |
Data format |
%judge,%value[%id],%judge[%id] |
Returned result |
0,100,0,200,0,300,0 |
|
Mapping relationship |
%judge,%value[1],%judge[1],%value[2],%judge[2],%value[3],%judge[3] |
|
Example 2 |
Data format |
%judge, M%id, %value[%id], %judge[%id] |
Returned result |
0,M1,100,0,M2,200,0,M3,300,0 |
|
Mapping relationship |
%judge,M1,%value[1],%judge[1],M2,%value[2],%judge[2],M3,%value[3],%judge[3] |
|
Example 3 |
Data format |
%judge, V%value[%id], J%judge[%id] |
Returned result |
0,V100,J0,V200,J0,V300,J0 |
|
Mapping relationship |
%judge,V%value[1],J%judge[1],V%value[2],J%judge[2],V%value[3],J%judge[3] |
Examples 2 and 3 are examples of adding character prefixes. In example 2, M%id stitches the character M together with the ID of the measurement item in the output. In example 3, V%value[%id] and J%judge[%id] add the characters V and J before the measured value and judgment result of each measurement item respectively. |
Set Other Data Formats
Parameter | Description |
---|---|
Floating-point decimal places |
Specifies the number of decimal places to keep when the software outputs the measured values. The value ranges from 0 to 20. The default value is 4. |
String delimiter |
Specifies the delimiter used to separate data (between the command name and parameter, and between parameters) in TCP command requests. Common string delimiters include the English comma (,) and semicolon (;). By default, the string delimiter is the English comma. |
String terminator |
Specifies the string terminator of commands. Common string terminators are \n and \r. By default, the terminator is \r. |
Invalid value |
Specifies the data format when there are no measured values or no judgment results. The default value is invalid. |