## 4 System Implementation
### Implementing the Experiment Layer  
The CP_Lab system is a widely commercialized learning platform developed by Festo, standing out for its integration with emerging Industry 4.0 technologies. This system offers an educational environment fully aligned with current industrial demands. In the field of mechatronics, didactic plants are predominantly composed of discrete and repetitive processes. Therefore, our system was specifically designed for these applications. To validate this approach, the CP_Mag_Front plant was chosen due to its operational pattern-based processes, allowing the execution of various distinct experiments within a single configuration. The experimental layer of this system was implemented using the didactic plants from the Industry 4.0 Laboratory at the Federal University of Amazonas, specifically the CP-Lab line of didactic plants by Festo. A remote-access structure was created to use these plants as Remote Laboratories. Figure 3 shows the didactic plant used and its actual components. Figure 3: Didactic plant of the remote laboratory. Figure 2: Detailed system architecture. The implementation of the didactic plant elements will be presented in the project design chapter, where the didactic plant comprises the following components:  
* Controller:  
In implementing this system, the industrial controllers can be programmable logic controllers--PLCs, microcontrollers, or computers. Nevertheless, in this didactic plant, the controller will be the Siemens S7-1500 PLC, where a mask for Ladder language was developed to facilitate the capture of data sent to the management element regardless of the communication protocol used. Figure 4 shows the mask used when the controller is a PLC because, with this device, the activity code generated by the student is not modified in its logic. This mask takes all the PLC inputs and outputs and takes their signals to known memories where these memories can be configured to share their states through the communication protocols existing in the PLC. For example, in the PLC of this implementation, the OPC-UA protocol was used to share the memory data. Figure 4 addresses Ix and Qx, representing the possible inputs and outputs in the PLC. The student's program is inserted into the remote laboratory controller through the management layer in the Lab DATA element where the student uploads it to the area of each experiment, which can be in ladder mode for PLCs or Python in the case of PCs and microcontroller platforms. * Didactic Experiments:  
For the implementation of this system, the plant called Mag_front was used, which is part of the CP_LAB line. The Mag_front plant is responsible for inserting the back part of the cell phone into the transport cart of the didactic plant. This plant includes sensors and buttons as input elements for the PLC, as well as the conveyor belt, pneumatic actuators, and signal indicators as output elements to be operated by the PLC. Figure 5 shows the virtual design of the didactic plant. Figure 4: Mask to use in the PLC controller. Figure 5: Didactic plant of the experiment in the implementation of the system. * Manager Element: The management element was implemented to monitor and capture experiment data through the communication protocol selected when registering information in the management layer. In the case of this educational experiment, OPC-UA was chosen to capture the data. The management element is a software that was implemented to run on the computer in the remote laboratory where the experiments are being conducted, checking the data that were modified during the execution of the experiment. The architecture of this element works by waiting for changes in the state of the inputs and outputs of the educational experiment. For each modification, the data were captured effectively, and the execution of the management element was divided into multiple processes, which resulted in increased monitoring speed to capture all the data.