How to reference .tlc files

35 vues (au cours des 30 derniers jours)
Valeriy
Valeriy le 23 Déc 2025
Réponse apportée : Raghavendra le 13 Jan 2026 à 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?

Réponse acceptée

Raghavendra
Raghavendra le 13 Jan 2026 à 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

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by