The article presents the possibility of using a 3D environment to simulate the operation of a manufacturing process and control a virtual object with a PLC. A sample application of the Factory I/O environment compatible with TIA Portal software and the real S7-1214 DC/DC/DC controller is presented. Visualization and program code written in LAD language correlated with the 3D environment were presented. The results showed the importance of a dynamic programming environment that reflects the program code designed to sort virtual production line components. The research showed that working with the code and the virtual object experiences students and is closer to industrial solutions than just laboratory ones.