How do I generate Simulink Profiler Report with execution times of subsystems in my model?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 7 Mag 2020
Risposto: MathWorks Support Team
il 27 Mag 2020
My Simulink model interfaces with real-time hardware and performs three tasks:
1) Read sensor data from an external device.
2) Perform calculations.
3) Write control commands to the external device.
The blocks involved in each of these tasks are encapsulated in separate subsystem blocks. I want to know how much time is spent within each subsystem block during a simulation run.
How do I create a Simulink Profiler report with execution times reported in this format?
Risposta accettata
MathWorks Support Team
il 7 Mag 2020
To set Simulink Profiler to generate a report with the rows in the table showing the processing time taken by each task's subsystem block, follow these steps:
For the subsystem block corresponding to each of the tasks in the model,
1. Right-click on the subsystem block and click on "Block Parameters (Subsystem)" near the bottom of the menu.
2. In the "Main" tab, enable the "Treat as atomic unit" option.
3. In the "Code Generation" tab, in the drop-down menu for "Function Packaging:", select the "Reusable function" option.
4. Click the "OK" button.
In the Simulink model, navigate to the following setting:
Configuration Parameters > "Verification" tab > Measure function execution times
Set to "Coarse (referenced models and subsystems only)"
Click on the OK button.
Now follow one of the procedures to run the model with the profiler on, such as:
>> modelName = 'simulink_model_filename_noExt';
>> load_system(modelName)
>> set_param(modelName,'Profile','on')
>> sim(modelName);
The above solution was verified in MATLAB R2019b.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Subsystems 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!