Utilising Digital Twins to Bolster the Sustainability of Logistics Processes in Industry 4.0

: Industry 4.0, characterized by the integration of advanced technologies, has allowed industries to optimise operations, reduce waste, and minimize environmental impact. Digitalization has become a cornerstone for achieving sustainability goals, and one of the key enablers of Industry 4.0 is the digital twin. The digital twin provides real-time insights and simulations to optimise processes. Organizations can thus optimise not only their operations but also contribute to a more resilient global supply chain. The aim of the paper is to present a comprehensive methodology for implementing the digital twin principle in the Tecnomatix environment. The Tecnomatix model is connected to Siemens PLC SIMATIC S7-1200 utilizing the OPC UA (Unified Architecture) method and through KEPServerEX, V6.14.263.0. The described approach enables continuous monitoring of critical indicators to optimise production efficiency and address downtime issues.


Introduction
Digitisation and integration of intelligent technologies into production processes are indispensable for sustainability in an ever-evolving industrial environment.Sustaining economic growth must be addressed from a long-term perspective, e.g., by finding ways to deal with energy, resource, and environmental constraints [1,2].In finding solutions to these problems, the great hope is the industrial revolution of Industry 4.0.Industry 4.0 is the implementation of cyber-physical systems for creating smart factories using the Internet of Things, big data, cloud computing, artificial intelligence, and communication technologies for information and communication in real time over the value chain [3].Industry 4.0 brought innovations that reshaped traditional production processes and influenced supply chain processes in various facets [4][5][6].At the forefront of Industry 4.0. is the concept of digital twins (DTs).The digital twin is a virtual model duplicating physical components and behaviours.DT is formed by employing sensors to capture real-time data from real-world elements.The digital twin introduces Industry 4.0 capabilities to traditional industrial manufacturing.The digital twin is at the heart of Industry 4.0 development, encompassing automation, data interchange, and manufacturing processes, creating limitless chances for companies to thrive [7].DT, as the digital version of a physical system, captures data about system activity in real-time.In the context of sustainability, digital twins offer a dynamic and comprehensive view of industrial processes, allowing for precise resource management and optimisation.The issue of the digital twin application is described in various contexts in the literature.Terminologically, the topic of DT was dealt with in [8], which analysed the definition of the DT concept in scientific literature and proposed the definition of DT for Industry 4.0 manufacturing.Interesting information can be found in review articles.One of them is the article by Melesse et al. [9].These authors conducted a systematic literature is still lacking due to power requirements.Bauer et al. [32] developed a hardware engine that offloaded the processing of the OPC UA protocol.Cyber-Physical Machine Tools (CPMT) represent a new generation of machine tools.The development of CPMT requires standardised information modelling methods and communication protocols for machine tools.With this intention, Liu et al. [33] proposed a CPMT Platform based on OPC UA and MTConnect that enables efficient data communication.
A virtual model of the real system can be created in various software environments.The preferred choice is often Tecnomatix Plant simulation software.The Tecnomatix program is utilised to model, simulate, visualize, and analyse production systems and logistic processes to optimise material flow and resource utilisation.For example, Gutmann et al. [34] implemented digital twin technology in Tecnomatix to optimise the balance between power consumption and productivity, and Jakhotiya et al. [35] utilised Tecnomatix Process Simulate to generate a digital twin of the actual KUKA LBR cobot.Likewise, Ružarovský and Skýpala [36] tested the information exchange between the virtual control system, using the Tecnomatix Process Simulate software, on the digital twin side and the Siemens TIA Portal with PLC SIM Advanced on the controller side.Similarly, Židek et al. [37] utilised a digital twin for an experimental assembly system.A digital twin was created using CAD design software (CDS) and imported to a Tecnomatix platform to simulate all processes.
As can be seen, the synergy of digital technologies and sustainability objectives creates a pathway towards a more responsible and resilient industrial society.Digital twins offer real-time insights into operations, facilitating swift responses to disruptions, minimizing downtime, and reducing resource wastage.By optimising logistic flows and identifying efficiency opportunities, digital twins promote resource conservation and environmental sustainability.Moreover, their predictive capabilities enable proactive maintenance, extending equipment lifespan and curbing unnecessary resource consumption.Overall, the integration of digital twins in production logistics aligns with sustainability goals by fostering operational efficiency, reducing environmental impact, and promoting resource stewardship.
The objective of this research is the application of the digital twin principle on a PLCcontrolled production line.Partial research tasks include model creation, determination of switches and sensors in the Tecnomatix environment, establishing connections between physical inputs and Tecnomatix, Tecnomatix and KEPServerEX, and creating between the PLC and PC.The presented approach provides a comprehensive methodology for connecting virtual and real systems and ensuring the monitoring of critical indicators to optimise production line efficiency.The line digital twin is created in the Tecnomatix Plant Simulation version 2302.The virtual system is connected to Siemens PLC SIMATIC S7-1200 using the OPC UA and KEPServerEX V6.14.263.0.

Research Problem and Methodology Description
The implementation of the digital twin principle offers the advantage of transferring real-time information that refers to the status of individual machines and various equipment across all production processes.This information facilitates swift responses to machine malfunctions or conditions caused by their weaning.The adapted data further enables the simulation of processes, and, partially, also prepares for other unforeseen situations.
Based on the above, an empirical examination of the digital twin concept was undertaken on a hypothetical production line, employing four inputs: three mechanical limit switch buttons and one photoelectric sensor with reflex detection.The integration of these inputs was achieved through a SIEMENS PLC SIMATIC S7-1200 manufactured by Siemens, establishing connectivity via an Ethernet cable directly linked to a laptop.The production line visualisation and simulation were conducted using Siemens Tecnomatix Plant Simulation, supported by additional application resources such as SIEMENS TIA portal and PTC Kepware KEPServerEX.We opted for these methods because Tecnomatix Plant Simulation is a powerful tool that offers comprehensive capabilities for modeling and simulating production systems [35].In conjunction with the TIA Portal, Tecnomatix enables the design and simulation of manufacturing systems while directly interfacing with PLCs.This integration ensures that the simulated model accurately reflects the behaviour of the real-world production line.KEPServerEx is chosen due to its ability to provide a unified source of industrial data to all automation devices with limitless tag support.Unlike other OPC servers, KEPServerEx maintains consistent speed regardless of tag count [38].Integrating KEPServerEX and TIA Portal with Tecnomatix Plant Simulation creates a robust simulation environment.The scheme presenting the structure and connections of the digital twin is shown in Figure 1.Plant Simulation, supported by additional application resources such as SIEMENS TIA portal and PTC Kepware KEPServerEX.We opted for these methods because Tecnomatix Plant Simulation is a powerful tool that offers comprehensive capabilities for modeling and simulating production systems [35].In conjunction with the TIA Portal, Tecnomatix enables the design and simulation of manufacturing systems while directly interfacing with PLCs.This integration ensures that the simulated model accurately reflects the behaviour of the real-world production line.KEPServerEx is chosen due to its ability to provide a unified source of industrial data to all automation devices with limitless tag support.Unlike other OPC servers, KEPServerEx maintains consistent speed regardless of tag count [38].Integrating KEPServerEX and TIA Portal with Tecnomatix Plant Simulation creates a robust simulation environment.The scheme presenting the structure and connections of the digital twin is shown in Figure 1.Our research hypothesis posits that the result of the connections, coupled with software and hardware configurations, leads to a functional digital twin in SIEMENS Tecnomatix Plant Simulation version 2302.This digital twin is anticipated to capture and record input stimuli.

Model Creation in Tecnomatix Plant Simulation: Starting Situation
In Tecnomatix Plant Simulation, the DT of a production line is modelled featuring four workstations served using a gantry loader, supplemented through two conveyors (Figure 2).Initial products for processing are directed to workstation no. 1.Part moving between workstations no. 1 to no. 4 is executed via a gantry loader equipped with two heads.Upon completion of processing at workstation no. 4, parts are automatically conveyed away.Our research hypothesis posits that the result of the connections, coupled with software and hardware configurations, leads to a functional digital twin in SIEMENS Tecnomatix Plant Simulation version 2302.This digital twin is anticipated to capture and record input stimuli.

Model Creation in Tecnomatix Plant Simulation: Starting Situation
In Tecnomatix Plant Simulation, the DT of a production line is modelled featuring four workstations served using a gantry loader, supplemented through two conveyors (Figure 2).Initial products for processing are directed to workstation no. 1.Part moving between workstations no. 1 to no. 4 is executed via a gantry loader equipped with two heads.Upon completion of processing at workstation no. 4, parts are automatically conveyed away.In the basic model of DT (Figure 2), a singular method, namely the initialisation method denoted by Method_Gantry_Loader (Figure 3), is used to control the movement of the gantry loader, manipulation of parts, and relocation of the gantry loader between workstations.To ensure the proper functioning of this method, it must be defined on the first workstation (Controls-Exit: Method_Gantry_Loader).In the basic model of DT (Figure 2), a singular method, namely the initialisation method denoted by Method_Gantry_Loader (Figure 3), is used to control the movement of the gantry loader, manipulation of parts, and relocation of the gantry loader between workstations.To ensure the proper functioning of this method, it must be defined on the first workstation (Controls-Exit: Method_Gantry_Loader).
ware and hardware configurations, leads to a functional digital twin in SIEMENS Te matix Plant Simulation version 2302.This digital twin is anticipated to capture and re input stimuli.

Model Creation in Tecnomatix Plant Simulation: Starting Situation
In Tecnomatix Plant Simulation, the DT of a production line is modelled featu four workstations served using a gantry loader, supplemented through two conve (Figure 2).Initial products for processing are directed to workstation no. 1.Part mo between workstations no. 1 to no. 4 is executed via a gantry loader equipped with heads.Upon completion of processing at workstation no. 4, parts are automatically veyed away.In the basic model of DT (Figure 2), a singular method, namely the initialisa method denoted by Method_Gantry_Loader (Figure 3), is used to control the movem of the gantry loader, manipulation of parts, and relocation of the gantry loader betw workstations.To ensure the proper functioning of this method, it must be defined on first workstation (Controls-Exit: Method_Gantry_Loader).

Inputs (Switches and Sensor)
In our scenario, the hypothetical production line, whose DT is modelled in Tecnomatix, is represented by four inputs, encompassing two types: mechanical limit switches and a photoelectric sensor with reflex detection.The three mechanical limit switches are determined to stop the machines and are designated for each type of machine, namely conveyors, the gantry loader, and workstations.The remaining input, represented by the photoelectric sensor, is designated to tally finished products after their final processing stage.
Drawing upon our designated inputs and the created model, the monitoring system in Tecnomatix includes ten attributes, observed and analysed for operational insights: the current state of conveyors (in service or out), the current state of the gantry loader (in service or out), the current state of workstations (in service or out), number of manufactured products, number of conveyor stops, total downtime of conveyors, number of gantry loader stops, total downtime of gantry loader, number of workstations stops, and total downtime of workstations.

Connections and Operation
The production line (presented in Figure 2) is currently running only in simulation mode, without the possibility to influence its operation using external inputs.
In order to receive real input data into the Tecnomatix model, we attach the OPC UA object to the model in Tecnomatix (located in Toolbox-Information Flow-OPC UA).The OPC UA interface is an interface between Plant Simulation and control and automation technology systems, facilitating the exchange and access of data.It enables access to process monitors, particularly PLC controls, through the OPC Unified Architecture.The OPC UA Interface functions as a client, capable of both reading and writing control variables and signals of PLC controls.The term "OPC" stands for Open Platform Communications [39].The embedded OPC UA object is designed to communicate with the KEPServerEX software V6.14.263.0, which serves as an intermediary, receiving data from Siemens PLC.
KEPServerEX provides a single source of industrial automation data for your application.It enables users to connect, manage, monitor, and control diverse automation devices and software applications through a unified and user-friendly interface.KEPServerEX leverages OPC (the automation industry's standard for interoperability) and IT-centric communication protocols to provide users with a single source for industrial data [40].In our case, KEPServerEX functions as the intermediary linking Tecnomatix Plant Simulation and PLC Simatic S7-1200 manufactured by Siemens.
The Siemens PLC, specifically the S7-1200 model, represents a programmable logic controller designed for industrial computing, robustly adapted for the control of manufacturing processes such as assembly lines, machines, robotic devices, or any activity requiring high reliability, ease of programming, and fault diagnosis capabilities.The PLC S7-1200 in use receives data from the input devices (switches and sensors) and transmits this data to the KEPServerEX software for subsequent processing.
The Totally Integrated Automation (TIA) Portal provides unrestricted access to a complete spectrum of digitised automation services, ranging from digital planning to integrated engineering and transparent operation [41].Its role in our context is the acquisition of the IP address for the PLC S7-1200.
In this section, the required connections between individual elements are undertaken to facilitate the data acquisition as defined above.The process is oriented towards progressing from the inputs to Tecnomatix, thus ensuring a systematic flow of information within the system.The information flow can be seen in Figure 4.

Creating Connections between Inputs and Tecnomatix
The integration of the inputs (three mechanical switches and the photoelectric sensor) is through mechanical connections to the PLC S7-1200.Prior to the operations, testing was realised by pressing the buttons.This testing aimed to validate the functional integrity of the input devices-the corresponding digital input should light up on the PLC.After pressing the button "ON/OFF Stations", the address I0.4 lit up (Figure 5).It works in the same way for other inputs.When pressing the button "ON/OFF Conveyors", the address I0.3 lit up, and when pressing the button "ON/OFF Gantry loader", the address I0.2 lit up.For the photoelectric sensor, it is necessary to interrupt the light beam reflected from the opposite reflective surface, and then the address I0.0 lit up.

Creating a Connection between PLC and PC
After creating connections between inputs and Tecnomatix, the task is establishing a connection between the Siemens PLC SIMATIC S7-1200 and the notebook.The procedure involves finding out the Siemens PLC IP address, a process facilitated through the Siemens TIA Portal.
The advantage of using a notebook for this connection lies in its flexibility, allowing simultaneous access to the Internet via WiFi, and at the same time, the notebook can be physically connected to the PLC via an Ethernet cable by entering a manual IP address (if the notebook is equipped with an Ethernet port).
In accordance with the determined IP address of the PLC, a selection of an Ethernet connection on the computer within the identical address range is imperative.For example, the assigned IP address to our PLC is 192.168.234.85;consequently, we manually configure the computer's IP address to 192.168.234.86, with a subnet mask of 255.255.255.0,

Creating Connections between Inputs and Tecnomatix
The integration of the inputs (three mechanical switches and the photoelectric sensor) is through mechanical connections to the PLC S7-1200.Prior to the operations, testing was realised by pressing the buttons.This testing aimed to validate the functional integrity of the input devices-the corresponding digital input should light up on the PLC.After pressing the button "ON/OFF Stations", the address I0.4 lit up (Figure 5).It works in the same way for other inputs.When pressing the button "ON/OFF Conveyors", the address I0.3 lit up, and when pressing the button "ON/OFF Gantry loader", the address I0.2 lit up.For the photoelectric sensor, it is necessary to interrupt the light beam reflected from the opposite reflective surface, and then the address I0.0 lit up.

Creating Connections between Inputs and Tecnomatix
The integration of the inputs (three mechanical switches and the photoelectric sensor) is through mechanical connections to the PLC S7-1200.Prior to the operations, testing was realised by pressing the buttons.This testing aimed to validate the functional integrity of the input devices-the corresponding digital input should light up on the PLC.After pressing the button "ON/OFF Stations", the address I0.4 lit up (Figure 5).It works in the same way for other inputs.When pressing the button "ON/OFF Conveyors", the address I0.3 lit up, and when pressing the button "ON/OFF Gantry loader", the address I0.2 lit up.For the photoelectric sensor, it is necessary to interrupt the light beam reflected from the opposite reflective surface, and then the address I0.0 lit up.

Creating a Connection between PLC and PC
After creating connections between inputs and Tecnomatix, the task is establishing a connection between the Siemens PLC SIMATIC S7-1200 and the notebook.The procedure involves finding out the Siemens PLC IP address, a process facilitated through the Siemens TIA Portal.
The advantage of using a notebook for this connection lies in its flexibility, allowing simultaneous access to the Internet via WiFi, and at the same time, the notebook can be physically connected to the PLC via an Ethernet cable by entering a manual IP address (if the notebook is equipped with an Ethernet port).
In accordance with the determined IP address of the PLC, a selection of an Ethernet connection on the computer within the identical address range is imperative.For example, the assigned IP address to our PLC is 192.168.234.85;consequently, we manually configure the computer's IP address to 192.168.234.86, with a subnet mask of 255.255.255.0,

Creating a Connection between PLC and PC
After creating connections between inputs and Tecnomatix, the task is establishing a connection between the Siemens PLC SIMATIC S7-1200 and the notebook.The procedure involves finding out the Siemens PLC IP address, a process facilitated through the Siemens TIA Portal.
The advantage of using a notebook for this connection lies in its flexibility, allowing simultaneous access to the Internet via WiFi, and at the same time, the notebook can be physically connected to the PLC via an Ethernet cable by entering a manual IP address (if the notebook is equipped with an Ethernet port).
In accordance with the determined IP address of the PLC, a selection of an Ethernet connection on the computer within the identical address range is imperative.For example, the assigned IP address to our PLC is 192.168.234.85;consequently, we manually configure the computer's IP address to 192.168.234.86, with a subnet mask of 255.255.255.0,leaving the gateway field blank (Figure 6).It is crucial to note that identical IP addresses between the computer and the PLC would impede communication.
Sustainability 2024, 16, x FOR PEER REVIEW 8 leaving the gateway field blank (Figure 6).It is crucial to note that identical IP addr between the computer and the PLC would impede communication.Verification of the established connection between the computer and the PLC is ducted through the Windows operating system command line (cmd) employing the P command.This diagnostic procedure ensures the operational integrity of the comm cation link, validating the success of the configured IP addresses and their compatib within the designated network.The deliberate avoidance of identical IP addresses e nates potential conflicts and establishes a coherent network infrastructure, laying groundwork for seamless communication.

Setting up PTC Kepware KEPServerEX
Commencing the KEPServerEX application, we initiate the process by creating a project.Within the project properties, the parameter "Allow anonymous login" is co ured with a value of YES (Figure 7a).Subsequently, we proceed to establish a comm cation channel, opting for the "Siemens TCP/IP Ethernet" selection, given the utilis of a Siemens PLC in our setup (Figure 7b).The remaining settings are maintained at default configurations.Following the channel configuration, the subsequent step involves the selection Verification of the established connection between the computer and the PLC is conducted through the Windows operating system command line (cmd) employing the PING command.This diagnostic procedure ensures the operational integrity of the communication link, validating the success of the configured IP addresses and their compatibility within the designated network.The deliberate avoidance of identical IP addresses eliminates potential conflicts and establishes a coherent network infrastructure, laying the for seamless communication.

Setting up PTC Kepware KEPServerEX
Commencing the KEPServerEX application, we initiate the process by creating a new project.Within the project properties, the parameter "Allow anonymous login" is configured with a value of YES (Figure 7a).Subsequently, we proceed to establish a communication channel, opting for the "Siemens TCP/IP Ethernet" selection, given the utilisation of a Siemens PLC in our setup (Figure 7b).The remaining settings are maintained at their default configurations.leaving the gateway field blank (Figure 6).It is crucial to note that identical IP addresses between the computer and the PLC would impede communication.Verification of the established connection between the computer and the PLC is conducted through the Windows operating system command line (cmd) employing the PING command.This diagnostic procedure ensures the operational integrity of the communication link, validating the success of the configured IP addresses and their compatibility within the designated network.The deliberate avoidance of identical IP addresses eliminates potential conflicts and establishes a coherent network infrastructure, laying the groundwork for seamless communication.

Setting up PTC Kepware KEPServerEX
Commencing the KEPServerEX application, we initiate the process by creating a new project.Within the project properties, the parameter "Allow anonymous login" is configured with a value of YES (Figure 7a).Subsequently, we proceed to establish a communication channel, opting for the "Siemens TCP/IP Ethernet" selection, given the utilisation of a Siemens PLC in our setup (Figure 7b).The remaining settings are maintained at their default configurations.Following the channel configuration, the subsequent step involves the selection of a specific PLC for the project.In this context, the PLC designated for integration is the SI-MATIC S7-1200 model.This selection aligns the KEPServerEX application with the specifications of the targeted PLC, ensuring seamless communication.Following the channel configuration, the subsequent step involves the selection of a specific PLC for the project.In this context, the PLC designated for integration is the SIMATIC S7-1200 model.This selection aligns the KEPServerEX application with the specifications of the targeted PLC, ensuring seamless communication.
Subsequently, we are prompted to input an identifier, wherein the IP address of the Programmable Logic Controller (PLC) is specified (192.168.234.85).Without changing the remaining parameters, the configuration process continues until the device is created.
The subsequent task entails the generation of "TAGS" corresponding to the predefined inputs articulated at the outset.The TAGS address matches the port on the PLC.If the addresses for the individual tags are set correctly upon accessing the Quick Client, the values should manifest in a "GOOD" state, indicative of accurate configuration.Conversely, incorrectly configured addresses would manifest as a "BAD" state.Additionally, the Quick Client provides a real-time representation of the current state of the inputs.(Figure 8).
Sustainability 2024, 16, x FOR PEER REVIEW 9 Subsequently, we are prompted to input an identifier, wherein the IP address o Programmable Logic Controller (PLC) is specified (192.168.234.85).Without changing remaining parameters, the configuration process continues until the device is created The subsequent task entails the generation of "TAGS" corresponding to the pr fined inputs articulated at the outset.The TAGS address matches the port on the PL the addresses for the individual tags are set correctly upon accessing the Quick Client values should manifest in a "GOOD" state, indicative of accurate configuration.C versely, incorrectly configured addresses would manifest as a "BAD" state.Addition the Quick Client provides a real-time representation of the current state of the inp (Figure 8).Upon actuating the "ON/OFF Stations" button at the input associated with the address I0.4, the value changed from 0 to 1.This serves as a validation of the seam communication nexus between the INPUTS (comprising switches and sensors), PLC and the KEPServer.In the ensuing phase, the configuration of Tecnomatix is underta to respond to inputs and record the requisite attributes, thus establishing an integr and responsive automation framework.

Creating a Connection between Tecnomatix and KEPServerEX
As previously explained, the integration of the OPCUA object serves as the con for establishing connectivity with the KEPServerEX application.The "Server na within the OPC UA object must align precisely with the data within the OPC UA Co uration Manager of the KEPServerEX application (Figure 9).When selecting "PLC1 within the OPCUA object, a novel table is opened, wherein the definition of TAGS sou from the Quick Client of the KEPServerEX application is executed.Notably, the T (Item ID) from Quick Client must also have the same names in Tecnomatix in the OPC object under "PLC1200" in the "Identifier" column (Figure 10).Upon actuating the "ON/OFF Stations" button at the input associated with the PLC address I0.4, the value changed from 0 to 1.This serves as a validation of the seamless communication nexus between the INPUTS (comprising switches and sensors), PLC, PC, and the KEPServer.In the ensuing phase, the configuration of Tecnomatix is undertaken to respond to inputs and record the requisite attributes, thus establishing an integrated and responsive automation framework.

Creating a Connection between Tecnomatix and KEPServerEX
As previously explained, the integration of the OPCUA object serves as the conduit for establishing connectivity with the KEPServerEX application.The "Server name" within the OPC UA object must align precisely with the data within the OPC UA Configuration Manager of the KEPServerEX application (Figure 9).When selecting "PLC1200" within the OPCUA object, a novel table is opened, wherein the definition of TAGS sourced from the Quick Client of the KEPServerEX application is executed.Notably, the TAGS (Item ID) from Quick Client must also have the same names in Tecnomatix in the OPCUA object under "PLC1200" in the "Identifier" column (Figure 10).Concomitantly, in the "Simulation Model Attribute" column of the OPC UA object, a method or variable is assigned to the established connection, which is further defined.After creating the connection between the INPUTS (buttons and sensor), PLC, PC, KEPS-ERVER, and TECNOMATIX, all that remains is to properly configure the production line so that when interacting with the inputs, Tecnomatix displays the correct data, and at the same time, the production line behaves according to the inputs, which we visualised.

Configuring Variables and Displays in Tecnomatix
In the Tecnomatix model, three button inputs were utilised, namely "ON/OFF Conveyors", "ON/OFF Gantry Loader", and "ON/OFF Stations", defined as global variables denoted as ON_OFF_Conveyors, ON_OFF_Gantry_Loader, and ON_OFF_Stations, respectively.These variables are of a boolean data type, initialised with a default value of "false".Within this triad of variables, the incorporation of "Observers" is facilitated through the "Tools", wherein a predefined value ("Value") is specified to invoke the associated method upon any alteration in the variable's state.This mechanism performs adjustments in the operational behaviour of the conveyors, gantry loader, and workstations in response to modifications in the corresponding variables.The specific methods  Concomitantly, in the "Simulation Model Attribute" column of the OPC UA object, a method or variable is assigned to the established connection, which is further defined.After creating the connection between the INPUTS (buttons and sensor), PLC, PC, KEPS-ERVER, and TECNOMATIX, all that remains is to properly configure the production line so that when interacting with the inputs, Tecnomatix displays the correct data, and at the same time, the production line behaves according to the inputs, which we visualised.

Configuring Variables and Displays in Tecnomatix
In the Tecnomatix model, three button inputs were utilised, namely "ON/OFF Conveyors", "ON/OFF Gantry Loader", and "ON/OFF Stations", defined as global variables denoted as ON_OFF_Conveyors, ON_OFF_Gantry_Loader, and ON_OFF_Stations, respectively.These variables are of a boolean data type, initialised with a default value of "false".Within this triad of variables, the incorporation of "Observers" is facilitated through the "Tools", wherein a predefined value ("Value") is specified to invoke the associated method upon any alteration in the variable's state.This mechanism performs adjustments in the operational behaviour of the conveyors, gantry loader, and workstations in response to modifications in the corresponding variables.The specific methods Concomitantly, in the "Simulation Model Attribute" column of the OPC UA object, a method or variable is assigned to the established connection, which is further defined.After creating the connection between the INPUTS (buttons and sensor), PLC, PC, KEPSERVER, and TECNOMATIX, all that remains is to properly configure the production line so that when interacting with the inputs, Tecnomatix displays the correct data, and at the same time, the production line behaves according to the inputs, which we visualised.

Configuring Variables and Displays in Tecnomatix
In the Tecnomatix model, three button inputs were utilised, namely "ON/OFF Conveyors", "ON/OFF Gantry Loader", and "ON/OFF Stations", defined as global variables denoted as ON_OFF_Conveyors, ON_OFF_Gantry_Loader, and ON_OFF_Stations, respectively.These variables are of a boolean data type, initialised with a default value of "false".Within this triad of variables, the incorporation of "Observers" is facilitated through the "Tools", wherein a predefined value ("Value") is specified to invoke the associated method upon any alteration in the variable's state.This mechanism performs adjustments in the operational behaviour of the conveyors, gantry loader, and workstations in response to modifications in the corresponding variables.The specific methods activated in this context are denoted as Method_Conveyors_ON_OFF, Method_Gantry_Loader_ON_OFF, and Method_Stations_ON_OFF (Figure 11).The photoelectric sensor, employing reflective detection, is configured through the variable denoted as "SUM_Products", characterised as an "Integer" data type and initialised with a default value of "0".The addition of individual components is delineated through the "Method_SUM_Products" method.
The subsequent step entails the establishment of counters for the downtime instances of individual equipment categories, specifically, "Conveyors stops", "Gantry loader stops", and "Stations stops".Additionally, the total downtime for each equipment category, namely "Conveyors downtime", "Gantry loader downtime", and "Stations downtime", is set.This is achieved through displays, accessed via "Toolbox-User interface-Display".Within these displays, the attributes to be monitored are specified.
In the case of conveyors, monitoring involves the attributes "StatStoppedCount" and "StatStoppedTime".It is relevant to note that different devices may have different attributes.For the gantry loader and workstations, the attributes "StatFailCount" and "StatFail-Time" are employed within the displays, facilitating the tracking of downtimes in terms of both count and duration (Figure 12).

Operation
Upon finishing all configurations, the Tecnomatix model is completed and ready for operation (Figure 13).The detailed adjustment of parameters and the establishment of required connections have been executed.After running the simulation in Tecnomatix Plant Simulation, our production line will aptly respond to the four inputs (three buttons and one photoelectric sensor) connected to the PLC.The photoelectric sensor, employing reflective detection, is configured through the variable denoted as "SUM_Products", characterised as an "Integer" data type and initialised with a default value of "0".The addition of individual components is delineated through the "Method_SUM_Products" method.
The subsequent step entails the establishment of counters for the downtime instances of individual equipment categories, specifically, "Conveyors stops", "Gantry loader stops", and "Stations stops".Additionally, the total downtime for each equipment category, namely "Conveyors downtime", "Gantry loader downtime", and "Stations downtime", is set.This is achieved through displays, accessed via "Toolbox-User interface-Display".Within these displays, the attributes to be monitored are specified.
In the case of conveyors, monitoring involves the attributes "StatStoppedCount" and "StatStoppedTime".It is relevant to note that different devices may have different attributes.For the gantry loader and workstations, the attributes "StatFailCount" and "StatFailTime" are employed within the displays, facilitating the tracking of downtimes in terms of both count and duration (Figure 12).activated in this context are denoted as Method_Conveyors_ON_OFF, Method_Gan-try_Loader_ON_OFF, and Method_Stations_ON_OFF (Figure 11).The photoelectric sensor, employing reflective detection, is configured through the variable denoted as "SUM_Products", characterised as an "Integer" data type and initialised with a default value of "0".The addition of individual components is delineated through the "Method_SUM_Products" method.
The subsequent step entails the establishment of counters for the downtime instances of individual equipment categories, specifically, "Conveyors stops", "Gantry loader stops", and "Stations stops".Additionally, the total downtime for each equipment category, namely "Conveyors downtime", "Gantry loader downtime", and "Stations downtime", is set.This is achieved through displays, accessed via "Toolbox-User interface-Display".Within these displays, the attributes to be monitored are specified.
In the case of conveyors, monitoring involves the attributes "StatStoppedCount" and "StatStoppedTime".It is relevant to note that different devices may have different attributes.For the gantry loader and workstations, the attributes "StatFailCount" and "StatFail-Time" are employed within the displays, facilitating the tracking of downtimes in terms of both count and duration (Figure 12).

Operation
Upon finishing all configurations, the Tecnomatix model is completed and ready for operation (Figure 13).The detailed adjustment of parameters and the establishment of required connections have been executed.After running the simulation in Tecnomatix Plant Simulation, our production line will aptly respond to the four inputs (three buttons and one photoelectric sensor) connected to the PLC.

Operation
Upon finishing all configurations, the Tecnomatix model is completed and ready for operation (Figure 13).The detailed adjustment of parameters and the establishment of required connections have been executed.After running the simulation in Tecnomatix Plant Simulation, our production line will aptly respond to the four inputs (three buttons and one photoelectric sensor) connected to the PLC.This responsiveness is possible because the methods created and assigned to individual devices react to changes in the state of variables.Simultaneously, the displays within the simulation environment monitor these dynamic states, displaying real-time visualisations of the monitored attributes.This comprehensive integration ensures an interactive simulation environment wherein the production line behaviour aligns with the responses to the inputs, thereby affirming the functionality of the digital twin.

Discussion and Conclusions
The aim of the presented study was the implementation of the digital twin principle in production logistics.The research result is a detailed methodology for creating the digital twin, its connection with the production system, and the application of additional resources.An empirical examination of the digital twin concept was conducted on a hypothetical production line controlled via SIEMENS PLC SIMATIC S7-1200.Visualisation and simulation were carried out using the Siemens Tecnomatix Plant Simulation program.To integrate the real input data into the Tecnomatix model, an OPC UA object was attached to facilitate data exchange between Tecnomatix Plant Simulation and PLC.The Siemens PLC S7-1200 receives data from input devices and transmits it to KEPServerEX for processing.The TIA Portal aids in acquiring the PLC's IP address.
Even though the principle of the digital twin is intensively discussed in the literature, there is a lack of DT implementation in the Technomatix Plant Simulation in the manufacturing context using the mentioned technologies.The main contribution of the research is filling this gap and introducing a detailed and comprehensive methodology for this specific case.Another application was presented, for instance, in [42], where TSN technologies were employed to resolve a similar issue, while our investigation leveraged KEPServ-erEX to furnish a consolidated interface and employed protocol translation.TSN is adopted as the communication channel to connect heterogeneous industrial automation subsystems.Similarly, De Giacomo et al. [20], using the DT concept, proposed an approach based on Markov Decision Processes to optimise the manufacturing process.A manufacturing assembly system is simulated in the Tecnomatix Plant Simulation environment [37], where a customised OPC server, written in Python, was implemented, and the gateway MindConnect was used to transfer data.
To summarise, through the implementation of the proposed approach, prompt access to real-time information about events and phenomena is attained.In this way, it is possible to quickly react to downtime or breakdowns and minimize losses during production and distribution.Concurrently, the acquired real-time data can be used to simulate alternative processes in the given environment, thereby enabling the identification of opportunities This responsiveness is possible because the methods created and assigned to individual devices react to changes in the state of variables.Simultaneously, the displays within the simulation environment monitor these dynamic states, displaying real-time visualisations of the monitored attributes.This comprehensive integration ensures an interactive simulation environment wherein the production line behaviour aligns with the responses to the inputs, thereby affirming the functionality of the digital twin.

Discussion and Conclusions
The aim of the presented study was the implementation of the digital twin principle in production logistics.The research result is a detailed methodology for creating the digital twin, its connection with the production system, and the application of additional resources.An empirical examination of the digital twin concept was conducted on a hypothetical production line controlled via SIEMENS PLC SIMATIC S7-1200.Visualisation and simulation were carried out using the Siemens Tecnomatix Plant Simulation program.To integrate the real input data into the Tecnomatix model, an OPC UA object was attached to facilitate data exchange between Tecnomatix Plant Simulation and PLC.The Siemens PLC S7-1200 receives data from input devices and transmits it to KEPServerEX for processing.The TIA Portal aids in acquiring the PLC's IP address.
Even though the principle of the digital twin is intensively discussed in the literature, there is a lack of DT implementation in the Technomatix Plant Simulation in the manufacturing context using the mentioned technologies.The main contribution of the research is filling this gap and introducing a detailed and comprehensive methodology for this specific case.Another application was presented, for instance, in [42], where TSN technologies were employed to resolve a similar issue, while our investigation leveraged KEPServerEX to furnish a consolidated interface and employed protocol translation.TSN is adopted as the communication channel to connect heterogeneous industrial automation subsystems.Similarly, De Giacomo et al. [20], using the DT concept, proposed an approach based on Markov Decision Processes to optimise the manufacturing process.A manufacturing assembly system is simulated in the Tecnomatix Plant Simulation environment [37], where a customised OPC server, written in Python, was implemented, and the gateway MindConnect was used to transfer data.
To summarise, through the implementation of the proposed approach, prompt access to real-time information about events and phenomena is attained.In this way, it is possible to quickly react to downtime or breakdowns and minimize losses during production and distribution.Concurrently, the acquired real-time data can be used to simulate alternative processes in the given environment, thereby enabling the identification of opportunities to optimise logistics flows.Digital twins thus contribute to the efforts to ensure the sustainability of production logistics.
On the other hand, it is important to note that the paper primarily focused on the implementation of the digital twin concept using specific technologies (SIEMENS PLC SIMATIC S7-1200, Siemens Tecnomatix Plant Simulation program, OPC UA, KEPServerEX, and TIA Portal).This may limit the generalizability of the findings to contexts where different technologies are used.Also, the limitation is that the empirical examination is conducted on a hypothetical production line, which may not fully capture the complexities and variations present in real-world manufacturing environments.Further research could focus on developing and evaluating advanced optimisation techniques within the digital twin framework for production logistics.The possible research area is also to explore the applicability of the proposed methodology across different manufacturing contexts and with alternative technologies.This could involve comparative studies between different digital twin implementations or simulation environments.In relation to sustainability, it is also worth investigating the role of digital twins in promoting sustainability within production logistics beyond just minimizing losses.This could involve analysing the environmental impact of different logistics scenarios simulated using digital twins and identifying opportunities for resource efficiency improvements.By addressing these research limits and exploring these future research directions, researchers can further advance the understanding and implementation of digital twins in production logistics.

Figure 1 .
Figure 1.Elements and connections of a digital twin in the production line.Figure 1. Elements and connections of a digital twin in the production line.

Figure 1 .
Figure 1.Elements and connections of a digital twin in the production line.Figure 1. Elements and connections of a digital twin in the production line.

Figure 2 .
Figure 2. DT of the production line modelled in Tecnomatix (starting situation).

Figure 2 .
Figure 2. DT of the production line modelled in Tecnomatix (starting situation).

Figure 2 .
Figure 2. DT of the production line modelled in Tecnomatix (starting situation).

Figure 4 .
Figure 4. Scheme of information flow.

Figure 5 .
Figure 5. Inputs for data collection (a): lightning up of the corresponding address (I0.4) on the PLC after pressing the button "ON/OFF Stations" (b).

Figure 4 .
Figure 4. Scheme of information flow.

Figure 4 .
Figure 4. Scheme of information flow.

Figure 5 .
Figure 5. Inputs for data collection (a): lightning up of the corresponding address (I0.4) on the PLC after pressing the button "ON/OFF Stations" (b).

Figure 5 .
Figure 5. Inputs for data collection (a): lightning up of the corresponding address (I0.4) on the PLC after pressing the button "ON/OFF Stations" (b).

Figure 7 .
Figure 7. Setting the item value "Allow anonymous login" (a): choosing the right channel type given project (b).

Figure 7 .
Figure 7. Setting the item value "Allow anonymous login" (a): choosing the right channel type for a given project (b).

Figure 7 .
Figure 7. Setting the item value "Allow anonymous login" (a): choosing the right channel type for a given project (b).

Figure 8 .
Figure 8. Verification of the correctness of entering addresses for tags in the Quick Client o KEPServerEX application.

Figure 8 .
Figure 8. Verification of the correctness of entering addresses for tags in the Quick Client of the KEPServerEX application.

Figure 9 .
Figure 9.Both IP addresses and port numbers match in Tecnomatix and KEPServerEX.

Figure 10 .
Figure 10.KEPServerEX Quick Client "Item ID" match the Tecnomatix OPC UA object in the ITEMS table under the "Identifier" column.

Figure 9 . 15 Figure 9 .
Figure 9.Both IP addresses and port numbers match in Tecnomatix and KEPServerEX.

Figure 10 .
Figure 10.KEPServerEX Quick Client "Item ID" match the Tecnomatix OPC UA object in the ITEMS table under the "Identifier" column.

Figure 10 .
Figure 10.KEPServerEX Quick Client "Item ID" match the Tecnomatix OPC UA object in the ITEMS table under the "Identifier" column.

Figure 11 .
Figure 11.Methods invoked by changing individual variables.

Figure 12 .
Figure 12.List of possible attributes for use in the display.

Figure 11 .
Figure 11.Methods invoked by changing individual variables.

Figure 11 .
Figure 11.Methods invoked by changing individual variables.

Figure 12 .
Figure 12.List of possible attributes for use in the display.

Figure 12 .
Figure 12.List of possible attributes for use in the display.

Figure 13 .
Figure 13.Completed digital twin in Tecnomatix environment.

Figure 13 .
Figure 13.Completed digital twin in Tecnomatix environment.