5 Ways MES and PLC Can Communicate!

◎ Author丨MES Communication Authorized Release5 Ways MES and PLC Can Communicate!

In the automotive manufacturing industry, MES has deep integration with the equipment layer, andPLC integration is the most mainstream form. This article mainly introduces several handshake methods and characteristics when integrating MES and PLC.

Method 1

Periodic Data Retrieval

Some key process parameters (such as the temperature of the gearbox shaft heat treatment furnace) are very important and need to be periodically retrieved to generate real-time curves for long-term traceability analysis.

These process parameters are usually analog quantities, and the values continuously change.

Typically, we can use OPC software to read this data, process it for accuracy, and then periodically write it into a real-time database.

The characteristics of this data are: high reading frequency and small data changes, so there will be a large number of duplicate records when stored in the database, and the real-time database provides data compression functionality, which is particularly suitable for storing this type of data.

Method 2

Condition-Based Trigger

Many process parameters (such as bolt tightening values) are collected mainly for post-quality traceability analysis, and we usually define a trigger signal to notify MES to read.

For example, after the engine completes the physical assembly operation at a certain station, PLC writes the key process parameters into the data exchange area, and then sets the DATA_READY signal.

Then, MES scans the DATA_READY signal every second; when this signal is high, it reads the quality traceability data from the data exchange area.

Refer to the figure below:

5 Ways MES and PLC Can Communicate!

The specific handshake process is:

  1. The engine completes a certain assembly step, PLC writes parameter 1.

  2. The engine completes a certain assembly step, PLC writes parameter 2.

  3. The engine completes all physical assembly operations, PLC sets DATA_READY . MES reads parameter 1 and parameter 2.

  4. The engine is ready to leave the current station, PLC resets all data.

Method 3

Request-Response Mechanism, 1 Handshake

This method is very similar to the message processing mechanisms of IT systems such as MQ/WEB SERVICE.

For example, when the engine is online at a station, MES sends a work order to PLC , the process can refer to the figure below:

5 Ways MES and PLC Can Communicate!

The specific handshake process is:

  1. PLC writes request data in PLC_MSG , such as the station, and sets REQUEST_SENT .

  2. MES scans REQUEST_SENT , reads PLC_MSG , generates work order data, writes it into MES_MSG , and sets RESPONSE_SENT .

  3. PLC scans RESPONSE_SENT , reads MES_MSG , writes it into the local data block, and resets REQUEST_SENT and PLC_MSG.

  4. MES resets all data and control bits.

We can see that the entire data exchange process only occurs once back and forth, that is, step 1-2, while steps 3-4 are the actions to destroy the message.

This method also has a characteristic of good encapsulation; the same interface can be used to issue work orders and upload station data, with the difference being that the data content stored in PLC_MSG/MES_MSG is different.

Method 4

Request-Response Mechanism, 2 Handshakes

Using the same example of the engine going online, the process can refer to the figure below:

5 Ways MES and PLC Can Communicate!

The specific handshake process is:

  1. PLC writes request data in PLC_MSG , such as the station.

  2. PLC sets REQUEST_SENT .

  3. MES scans REQUEST_SENT , reads PLC_MSG , then sends REQUEST_RECEIVED .

  4. MES generates work order data and writes it into MES_MSG .

  5. MES sets RESPONSE_SENT .

  6. PLC scans RESPONSE_SENT , reads MES_MSG , writes it into the local data block, and sets RESPONSE_RECEIVED .

  7. MES scans RESPONSE_RECEIVED , resets all data and control bits.

  8. PLC resets local data and control bits.

We can see that the entire process involves 2 handshakes, where steps 1-3 are the first handshake, used to receive requests; steps 4-8 are the second handshake, used to send data.

We can see that method 4 is much more complicated than method 3, but this method is still widely used in actual projects. This is because the complete response time can take several seconds, while the PLC scan cycle is only a few dozen milliseconds. The additional status bits can serve as status indicators to alleviate workers’ anxiety while waiting, and can also facilitate communication debugging.

Method 5

Based on Station Production Cycle

At some stations, there are multiple key business processes, such as the engine going online first, then assembly, and finally sending the station record.

During a complete station production cycle, PLC needs to exchange data with MES twice: the first time to download the work order and the second time to upload the station record, as shown in the figure below:

5 Ways MES and PLC Can Communicate!

The specific handshake process is:

  1. The engine arrives, PLC sets ENGINE_ARRIVAL .

  2. PLC checks the tray, equipment, and materials; after conditions are met, it sets STATION_READY .

  3. MES sets STATION_READY_RECEIVED .

  4. MES writes work order data into MES_DATA .

  5. MES sets MES_DATA_SENT .

  6. PLC writes MES_DATA into the local data block and sets MES_DATA_RECEIVED .

  7. MES resets all data and status bits on the IT side.

  8. PLC begins the assembly operation at this station and writes the engine serial number into ENGINE_SN .

  9. PLC completes assembly, PLC sets PLC_COMPLETE .

  10. MES sets PLC_COMPLETE_RECEIVED .

  11. MES executes station logic, and after completion, sets MES_COMPLETE .

  12. PLC sets MES_COMPLETE_RECEIVED .

  13. MES resets all data and status bits on the IT side.

  14. The engine is prepared to leave, PLC sets ENGINE_LEAVE .

  15. PLC resets all data and status bits.

We can see that this method is very complicated, but its advantages are:

  • All key states in the production cycle are reflected, making it easy to monitor through HMI .

  • PLC states correspond to the actual production execution situation, making it easy to trace when issues occur.

  • If a program error occurs, it is easy to see which step the communication has reached.

Additionally, we should understand that downloading work orders and uploading station records are only parts of the complete production cycle and have inherent logical connections. For example: if a problem is found with the cylinder block during the assembly process and a new cylinder block needs to be brought online, since MES has not yet received the station record, even when the STATION_READY signal is received for the second time, the work order issued by MES will still be the same, thus effectively avoiding the loss of the work order and engine serial number.

5 Ways MES and PLC Can Communicate!

5 Ways MES and PLC Can Communicate!

Leave a Comment