# Proactive Approach to Production Control Utilizing Heterogeneous Shop-Level Production Data
## 3 Methodology
### CSV for Production Orders
#### 3.1.3 Ability to Load Data from External Files  
By utilizing specialized algorithms for altering the shop-floor production schedule, with stochastic factors present, it is possible to create different scenarios and replications without the loss of initial data. The main benefits to this approach identified thus far directly correlate to the possibility of running an offline simulation without the need for active connections to the PCS or any other data sources.  
To achieve this functionality, it is important to implement a software module for a PCS which allows the operator to create various scenarios for the ongoing production process. Alternatively, building a custom-built interface or a series of interfaces with different functionalities is also an option, as these can be iterated and expanded upon, allowing for further production process customization. The only requirement for this approach is the ability to load the customized scenarios or production schedules back into the PCS, which implies that the involved systems must be fully integrated for data to be exchangeable between the subsystems. To prove the concept, as mentioned in previous chapters, we have developed a fully customizable GUI for the PCS at our disposal, which allowed us to proactively run multiple simulations with different scenarios using the DTw of our monitored PrS. The GUI was a MATLAB R2023b application, equipped with the functionality to load the specialized data files from the PCS, allowing the user, or a production operator, to make suitable adjustments to the shop-floor schedule before initiating the simulation. The endpoint of the data-altering process is followed by generating the data files containing the modified schedule for the simulator. In addition, the simulation process is initiated directly from the GUI using the command files.  
As presented in the conceptual model in Figure 3, after a successful simulation run, the data transfer back into the MES was narrowed down to a single data file containing the PO data. It was then a much simpler process, as our MES was equipped with a functionality which allowed it to identify the creation of new files with the specified parameters. Upon identifying a successful reading of the incoming data file, the extraction algorithm was initiated. The extraction algorithm was a custom script implemented to purposefully apply the simulated changes to the upcoming production schedule. A scenario where the simulation process can be deemed as unsuccessful (the \"no\" branch on the MES and Production system level in Figure 3) is a possible occurrence. This state is related to the prolonged or delayed acquisition of simulated data from the simulator (the simulator or the PCS was temporarily disconnected from the local network) or the inability to read the simulated data inside the MES (an error occurred during the simulation, preventing the generation of an output file in accordance with the pre-specified protocol). In this scenario, a relevant error message is displayed, presenting details about the cause of the error to the operator. Figure 4 displays an example of how the raw data collected from the MES is interpreted within the simulator after reading the CSV files. The interpretation adheres to the rules set up for the first case study presented further in this paper.