# Virtual Reality and Digital Twins for Catastrophic Failure Prevention in Industry 4.0
## 3 Workflow
In addition to this pop-up system, a criticality indicator was added to indicate the proximity of the parameterized values to the critical values. This indicator consisted of color variation tracking the measured values--green for normal values, yellow when they were at an intermediate level and red when they reached their critical values--as described by the color-coded indicators, which visually reflect the criticality level of the monitored parameter which visually reflect the criticality level of the monitored parameter. Such a visual representation constitutes an effective tool for real-time decision making, as it facilitates the interpretation of the risk level without the need for a complex technical analysis, thus reinforcing the usefulness of the TSS as an operational and preventive support [24]. To implement the early warning system, we first focused on the sensorization process and signal transmission, using as a reference the configuration diagram presented in [23]. This initial stage allowed us to establish a stable communication flow between the physical sensors and the digital environment, ensuring that real-time data could be accurately processed and visualized. The signal management logic, based on modular structures, was adapted and extended from the approach detailed in that previous work (Figure 3). Figure 4 shows the final configuration of Node-RED, the module that performs data collection and transmits the information to Unity, where the existence of five structures can be seen connected to a final module. These structures correspond to each of the sensors connected to the equipment. Figure 3: The workflow for the development of a new crawling engine experience [19]. Each of these structures was configured with the same structure depicted in Figure 5 and was divided into three main blocks, each with a specific function but interconnected to ensure the proper functioning of the proposed early warning system. Figure 6 presents a diagram of the structure whose function was to define and restrict the critical value of a parameter. Then, the next structure, which operates in parallel and is represented in Figure 7, oversees injecting data in such a way that it fluctuates and allows the desired simulation; it directly communicates the sensor data with the server in Blynk and its respective representation in Unity. Finally, the structure shown in Figure 8 receives data from both previous structures and interprets the values to send a warning signal to the simulation in Unity when a parameter reaches its critical value. This allows the freezing of the simulation, preserving the last data received, while feeding the pop-up system in Unity. Figure 4: Node-RED configuration. Sensors appear as “offline” during simulation because the PLC was intentionally disconnected to prevent conflicts between real and simulated data. Figure 5: Sensor node. Figure 6: Critical level configuration structure. For the pop-up-window system, two applications embedded in Unity were developed. The first one, whose configuration panel in Unity corresponds to the one shown in Figure 9, interpreted the data provided by Node-RED and executed a color change in the text representing the parameter values, signaling three different states with respect to operational status. Green indicated correct operation without problems; yellow appeared when the value approached a critical state, defined by a percentage of the critical value determined by the user; and finally, red indicated that the value had reached its maximum critical limit. The second application, corresponding to Figure 10, communicated directly with the previous one and had the function of identifying a color change in the source of any of the sensorized parameters. When parameterized data reached its maximum value, this application detected the red color in the source of the parameter and automatically activated the pop-up window, which indicated that the motor must be turned off and the respective inspection and/or maintenance work must be carried out.