Fareed Mohmed← EngineeringMES series

MES Integration Series · Part 2

Machine Data Mapping and MES Database Structure

How do PLC tags become fields in the MES database?

A PLC tag called Cycle_Time becomes a field called cycle_time_sec in the MES, with a unit, a data type and a rule for what is a valid value. This page lets you map and check a record yourself, shows a simple MES database and the SQL behind it, and answers questions from sample data. The example tags and values are not from a real plant.

0Key takeaways
1Data flow overview

The PLC or controller collects the machine data. The edge gateway maps it to the MES fields and checks it. The MES stores it in a database for live tracking, quality and traceability.

2Map and check one record
PLC tagMeaningPLC typeMES fieldExample

Change the raw PLC values on the left. The gateway converts units and names, then the MES rules decide whether the record is accepted. The rules are the ones in the case: data type, value range, mandatory fields, timestamp order, duplicates, allowed values and completeness.

3The MES database

The tables follow the case: machines, production orders, production data, quality data and alarm events. Production data is the centre: each row belongs to one machine and one order, and quality and alarm rows point back to it. Pick a table to see its fields and the SQL that creates it. The design is an example; yours will depend on your MES.

4Ask the database a question

The sample data below is generated for the demo (60 parts from two machines). The query runs on it as the MES would on its tables. Change the question to see the SQL and the answer.

5MES dashboard from the stored data
TimeSerial numberResultCycle time (s)

The tiles and the table are computed from the same sample records as the query above. Change the machine to filter.

6Data categories and examples
7Tag mapping: implementation steps
8Benefits
9Tools used at each stage
StageTools shown in the caseWhat they do here

The tools are examples, not recommendations. Choose by what your team owns and what your machines and PLCs support.

10Where to go next
11Sources

The database is a simplified example. Design the real schema with the MES supplier or your database team, and keep units, data types and time zones consistent.