Incorporating phase change materials (PCM) into multi-glazed windows (MW) has been recognized as an effective way to regulate the indoor thermal environment and reduce the energy consumption of buildings. However, the design and calculation of PCM-filled multi-glazed windows (MW + PCM) remain challenging due to the lack of general transient simulation methods and integrated tools. To address this issue, the present study developed a dynamic coupled thermal and optical model for MW + PCM based on the enthalpy-temperature and interface energy balance methods. Then, the model was implemented in C++ and integrated into the TRNSYS software as a new module (Type 2602). In parallel, a test platform comprising two test chambers was established to evaluate the effect of PCM on the thermal and optical properties of the window and to validate the newly proposed module. It was found that compared to the traditional triple-glazed window (TW), the PCM-filled triple-glazed window (TW + PCM) effectively reduces the irradiance through the window by 34.17 % and the maximum temperature of the inner surface by approximately 5.56 °C. While the increase in external surface radiation flux density from 600 to 1200 W/m2 has a diminishing effect on the heat flux variation rate during the heat dissipation process for TW + PCM, it effectively shortens the latent heat absorption time by 0.50 h and increases the temperature difference between the inner and outer surfaces by 3.02 °C. The new module demonstrates satisfactory accuracy through experimental validation and simulation comparisons, with the maximum heat flux coefficient of variance of the root mean square error (CV(RMSE)) less than 6.35 % and 11.25 % under TW and TW + PCM configurations.