
Why does generating C code for a "CAN Log" block throw the error "fatal error: dlfcn.h: No such file or directory" in MATLAB R2024b?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 11 Lug 2025
Modificato: MathWorks Support Team
il 21 Lug 2025
I want to generate C code for a model with a "CAN Log" block to log signals in MATLAB R2024b, however, the error message below is thrown. Why is this?
fatal error: dlfcn.h: No such file or directory
Risposta accettata
MathWorks Support Team
il 21 Lug 2025
Modificato: MathWorks Support Team
il 21 Lug 2025
The reason for this is that the "CAN Log" block is intended solely for host-based analysis and does not support code generation for deployment to target hardware.
As a workaround for logging signals on targets such as Arduino and Rasperry Pi, consider using "Simulink Data Inspector" while running the model in the "Model and Tune" mode.
First, instead of clicking on "Build, Deploy and Start", instead select the "Monitor & Tune" mode. This deploys the model and communicates with the deployed model on your hardware board during runtime.
For more information on this step, please refer to the documentation on signal monitoring and parameter tuning.
Next, to enable Simulink Data Inspector, you can select a signal and click the Wi-Fi icon that appears:

For more information on this step, please refer to the following documentation on data logging.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Code Generation and Deployment in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!