EtherNet/IP
Mech-MSR can communicate with external devices through EtherNet/IP. Before you read the following content, make sure that the communication configuration has been completed in Mech-MSR.
About EtherNet/IP
The EtherNet/IP protocol supports bidirectional data transmission between a PLC and Mech-MSR.
Communication Workflow
The workflow of EtherNet/IP communication is shown in the figure below.
| See Input and Output Signals to learn the meaning of each signal. |
Input and Output Signals
| Input (from the PLC to Mech-MSR) | Output (from Mech-MSR to the PLC) | ||||
|---|---|---|---|---|---|
Module |
Name |
Bytes Occupied |
Module |
Name |
Bytes Occupied |
Enable |
1 byte |
Heartbeat |
1 byte |
||
Command trigger |
Trigger acknowledge |
||||
Data read finished |
Data ready |
||||
Reset output data |
Command execution completed |
||||
Reserved |
Reserved |
||||
Reserved |
Reserved |
||||
Reserved |
Reserved |
||||
Reserved |
Error |
||||
Reserved |
3 bytes |
Overall judgment result |
1 byte |
||
Reserved |
|||||
Reserved |
|||||
Reserved |
|||||
Reserved |
|||||
Reserved |
|||||
Reserved |
|||||
Reserved |
|||||
Reserved |
2 bytes |
||||
Command code |
2 bytes |
Status code |
2 bytes |
||
Command parameter 1 |
2 bytes |
RESERVED |
Reserved |
2 bytes |
|
Command parameter 2 |
2 bytes |
Judgment result of ID 1 Judgment result of ID 2 Judgment result of ID 3 ... |
8 bytes |
||
Command parameter 3 |
2 bytes |
||||
Command parameter 4 |
2 bytes |
||||
Command parameter 5 |
2 bytes |
||||
Command parameter 6 |
2 bytes |
Measurement result of ID 1 Measurement result of ID 2 Measurement result of ID 3 ... |
256 bytes (4 bytes x 64) |
||
Command parameter 7 |
2 bytes |
||||
Command parameter 8 |
2 bytes |
||||
Command parameter 9 |
2 bytes |
||||
Command parameter 10 |
2 bytes |
||||
Variable 1 |
4 bytes |
||||
Variable 2 |
4 bytes |
||||
Variable 3 |
4 bytes |
||||
Variable 4 |
4 bytes |
||||
Variable 5 |
4 bytes |
||||
Variable 6 |
4 bytes |
||||
Variable 7 |
4 bytes |
||||
Variable 8 |
4 bytes |
||||
Variable 9 |
4 bytes |
||||
Variable 10 |
4 bytes |
||||
Input (from the PLC to Mech-MSR)
CONTROL_INPUT
| Address | Data | Description |
|---|---|---|
0.0 |
Enable (Boolean) |
Only when the enable signal is set to 1 are the other input signals considered valid. |
0.1 |
Command trigger (Boolean) |
Mech-MSR reads the command code and command parameters only when the command trigger signal changes from 0 to 1 (rising edge). After Mech-MSR returns the Trigger Acknowledge signal, the command trigger signal can be set to 0. |
0.2 |
Data read finished (Boolean) |
After the PLC finishes reading the data, set this signal to 1. Only after the PLC receives the Data Ready signal changing to 0 can this signal be set to 0. |
0.3 |
Reset output data (Boolean) |
When this signal is set to 1, the judgment results and measurement results received by the PLC (output) are cleared. At this point, the PLC can send a new command, and the related status code signals are also reset. |
0.4 |
Reserved (Boolean) |
Reserved field. |
0.5 |
Reserved (Boolean) |
Reserved field. |
0.6 |
Reserved (Boolean) |
Reserved field. |
0.7 |
Reserved (Boolean) |
Reserved field. |
1.0~3.7 |
Reserved (Byte) |
Reserved field. |
COMMAND & COMMAND_PARAM
The following table lists the supported commands in the current protocol and their corresponding command codes (COMMAND), command parameters (COMMAND_PARAM), and descriptions.
| Command | COMMAND | COMMAND_PARAM | Description |
|---|---|---|---|
execute |
1 |
Project ID. Only 1 project ID can be set at a time. |
Used to trigger a project to run and obtain the project’s judgment results and measurement results. |
trigger |
2 |
Project ID. 1 to 4 project IDs can be set at a time. |
Used to trigger a project to run. |
return |
3 |
Project ID. Only 1 project ID can be set at a time. |
Used to obtain the judgment results and measurement results of the specified project. |
judge |
4 |
Used to obtain the overall quality judgment result of the specified project or the quality judgment results of individual measurement items. |
|
value |
5 |
Mainly used to obtain the measurement values of the specified project. |
|
recipe |
6 |
Project ID and parameter recipe ID. |
Used to switch the parameter recipe used by a project. |
solution |
7 |
Solution ID. |
Used to switch a solution. |
SetNumVar |
8 |
Global variable ID. Only 1 can be set at a time. |
Used to set the value of a numeric global variable. The variable value is passed through VAR_INPUT. |
GetNumVar |
9 |
Global variable ID. Only 1 can be set at a time. |
Used to read the value of a numeric global variable. The result is returned through VALUE. |
|
VAR_INPUT
When the SetNumVar command is executed, the set value is written to VAR_INPUT.
| Address | Data | Description |
|---|---|---|
26.0~29.7 |
Variable 1 (Float) |
Numeric input parameter 1. |
30.0~33.7 |
Variable 2 (Float) |
Numeric input parameter 2. |
34.0~37.7 |
Variable 3 (Float) |
Numeric input parameter 3. |
38.0~41.7 |
Variable 4 (Float) |
Numeric input parameter 4. |
42.0~45.7 |
Variable 5 (Float) |
Numeric input parameter 5. |
46.0~49.7 |
Variable 6 (Float) |
Numeric input parameter 6. |
50.0~53.7 |
Variable 7 (Float) |
Numeric input parameter 7. |
54.0~57.7 |
Variable 8 (Float) |
Numeric input parameter 8. |
58.0~61.7 |
Variable 9 (Float) |
Numeric input parameter 9. |
62.0~65.7 |
Variable 10 (Float) |
Numeric input parameter 10. |
Output (from Mech-MSR to the PLC)
CONTROL_OUTPUT
| Address | Data | Description |
|---|---|---|
0.0 |
Heartbeat signal (Boolean) |
System heartbeat. It toggles every second. It can be used to determine whether the communication connection between the PLC and Mech-MSR is normal or disconnected. |
0.1 |
Trigger acknowledge (Boolean) |
When Mech-MSR receives the rising edge of the Command Trigger signal, this signal is set to 1. When the command trigger signal falls, this signal is set to 0. |
0.2 |
Data ready (Boolean) |
Mech-MSR writes data to the output port and waits for the PLC to read it. When the Data Read Finished signal is 1, this signal is set to 0. |
0.3 |
Command execution completed (Boolean) |
When command execution ends, this signal is set to 1, indicating that the command has been processed. |
0.4 |
Reserved (Boolean) |
Reserved field. |
0.5 |
Reserved (Boolean) |
Reserved field. |
0.6 |
Reserved (Boolean) |
Reserved field. |
0.7 |
Error (Boolean) |
When the status code returned by Mech-MSR is not 1, this signal is set to 1 to indicate an error. |
1.0 |
Overall judgment result (Boolean) |
The overall judgment result of the project. 1 indicates pass (OK), and 0 indicates fail (NG). |
1.1~1.7 |
Reserved (Boolean) |
Reserved field. |
2.0~3.7 |
Reserved (Byte) |
Reserved field. |
| Quality judgment rules must be configured for the project in the Output Management window of Mech-MSR, and the measurement items considered during quality judgment must be determined. Only after the configuration is complete can valid quality judgment results be obtained. |
STATUS_CODE
Mech-MSR may return the following status codes:
-
Normal status code: 1, indicating that the command was executed successfully.
-
Error status codes: -1, -2, -3, -4, and -5. See Error Codes for details.
JUDGE
The quality judgment results of measurement items added on the Communication Output tab in the Output Management window are returned here. 1 indicates pass (OK), and 0 indicates fail (NG).
| Up to 64 judgment results can be output at one time for a single project. |
VALUE
The VALUE module can return the following data:
-
The measurement results of the measurement items added on the Communication Output tab in the Output Management window.
-
The values of numeric global variables read when the
GetNumVarcommand is executed.
| Up to 64 measurement values can be output at one time for a single project. |