## 5 Discussion  
From the literature reviewed, it is evident that the development of DTs has been growing constantly in different industries and universities due to the characteristics, advantages, and opportunities it presents. However, there are still several challenges such as latency, architecture standardization, and transparency protocols, among others. In 2021, the ISO committee published ISO 23247 to standardize an architectural framework to support the creation of DTs for manufacturing applications. However, it is an open framework that allows for the use of different technologies and does not prescribe specific data formats or communication protocols. It should also be highlighted that the review carried out highlights that among all the enabling technologies of Industry 4.0, the DT is the one that leads the way for complete cyber-physical integration, whereby it facilitates the integration of human-machine knowledge in different industrial cyber-physical contexts quickly and flexibly. The present study has shown the implementation of an architecture for the implementation of DTs in Industry 4.0 where methodologies were defined to integrate new-generation and legacy equipment, several platforms were used to allow for horizontal and vertical integration of the system. The architecture was tested in an Industry 4.0 laboratory where the proposed framework for the DT was based on the ISO 23247 standard and its four application layers. The requirements that must be adhered to in the design of a DT were considered: (1) observable attributes of the manufacturing elements, that is, the elements that must be modeled, (2) the communication entity of the device that collects the state changes of the elements observable during manufacturing processes, (3) DT entities where the models of the DTs are modeled and updated based on the collected data, and (4) user entities which are applications that use DTs to make their manufacturing more efficient. In addition, it should be emphasized that the proposal presented can be implemented in both open-loop and closed-loop systems. For digital design, it is suggested to use preset designs from a manufacturer which can then be edited and adapted to the characteristics required for the system or standard used; one can also make the 3D design of the virtual environment from scratch, and it is recommended to complete this in software that allows saving in.stl extension format for subsequent simulation and interaction through Unity  
Figure 11: Histogram of the percentage of improvement of the DT-MES. with the physical environment. Regarding the physical environment, PLCs or low-cost embedded systems can be used in the control stage to control and send data from the sensors and actuators of the process; among the most used protocols that allow for bidirectional communication are OPC UA and MQTT. Finally, to allow for greater interaction with virtual environments, process data can be sent to the cloud, and from there, they can be managed for bidirectional interaction with any AR or VR technology; it is suggested to consider the number of TAGs used due to the high consumption of resources and amount of data to be processed. The results show that the combination of immersive DT with an MES for automation and supervision increases the characteristics of these systems at both the field, process, and management levels. Where there is a virtual representation in real time with simulation and interaction capabilities between the physical and virtual entities, this allows for a faster response to internal or external disturbances that may occur during the process. This ability to model and simulate possible scenarios with real production line data allows one to reduce downtime and improve decision-making. It was also evident that the DT adapts to existing production systems to create digital data compatible with the MES; in this way, these systems can be linked.