Error: ERROR: Code generation failed: Project export failed while using Twincat Target for Simulink
22 views (last 30 days)
Show older comments
I am trying to send simulink model to twincat using the twincat TE1400 TwinCAT 3 Target for Simulink. These are the softwares installed in my Windows 10 system, Visual Studio 2019 community; Matlab R2024b; Twincat 3.1 4024.55 with TE14xx-ToolsForMatlabAndSimulink installed and run on the Matlab command window as administrator. Twincat was manually integrated with VS 2019 in the setup itself. I created a simple simulink model with and AND operation.The config settings are attached below for my simulink model. The build completion was working with the code generation being successful and the model porting to the twincat XAE shell interface without any problems, until yesterday morning when i started to get this error.
Top model targets:
Model Build Reason Status Build Duration
=================================================================================================================================
TRIAL Information cache folder or artifacts were missing. Failed to build. For more information, see build log. 0d
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 23.303s
I tried searching for a solution online but was not able to find any. Can you guide me through this?
0 Comments
Answers (1)
Manish
on 4 Jun 2025
Hi,
I was working on a similar use case and encountered the same issue. After trying several approaches, I found a workaround that might be helpful for you as well.
In your current working directory in MATLAB, delete the slprj, work, and *_grt_rtw folders manually if they exist, or clear the code generation folders (those created using codegen).
Then, reopen your Simulink model and try building it again.
Hope this helps!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!