How to reference .tlc files
47 views (last 30 days)
Show older comments
Valeriy
on 23 Dec 2025 at 15:50
Answered: Raghavendra
on 13 Jan 2026 at 10:31
In my C2000 Blockset project I want to add custom backgroundTask() function inside the while(1){} loop. Modifying just the codetarget_file_process.tlc file is not enough to do that as this file in turn calls codertarget_mainwithoutOS.tlc where the ert_main.c file contents are created. I modified the codertarget_mainwithoutOS.tlc file to do what I need, but if I move the file from the location where it was installed (C:\Program Files\MATLAB\R2024b\toolbox\target\codertarget\rtw\codertarget_mainwithoutOS.tlc) to the folder inside my project it is no longer being copied to the \codegen\<project>\tlc folder and it is not found during build process.
How should I make sure the modified codertarget_mainwithoutOS.tlc is part of my project and is used to generate the code?
0 Comments
Accepted Answer
Raghavendra
on 13 Jan 2026 at 10:31
Hello Valeriy,
It is not recommended to modify the shipped TLC file to include a background task.
Instead, you can use the Idle Task block provided in Simulink to specify the functions that need to execute as background tasks.
Thanks,
Raghavendra Prasad
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!