Optimization is essential in industries today to increase efficiency and profitability.In the context of a production line for the prefabrication of walls, a section of theproduction line consisting of a Cartesian robot performs nailing on a stationarywall. From the time the wall enters the section until it exits, it is called cycle time,Tc , and it is used for evaluating the efficiency. The Tc could decrease if the wallis worked on as it moves through the section. An optimization of this section wasdeveloped on Siemens hardware and tested on a 1:10 scale version mimickingthe Cartesian robot that performs the nailing. The solution also uses parameteroptimization with Matlab and Simulink to achieve a station that will minimizewear on mechanical components. The new and optimized station was comparedto the Tc of a benchmark simulation where the wall remained stationary. Theresult showed a 43.2% decrease in Tc with the optimizations made. The parameteroptimization gave parameters to use that meant the robot would finish workingon the wall just before the wall left the work area. The report concludes that theoptimized application in the TIA Portal decreased the Tc by operating on a movingwall within the work area. Further improvements were identified to reduce thework area and Tc further at the cost of mechanical wear on components. Theprogram in the TIA Portal can be implemented in the production lines to increasethe efficiency of production lines for the prefabrication of walls.