I'm trying to measure execution time for the model run in PIL Simulation mode using Profiler function block.
But I'm facing issue in checking the output in Freemaster tool V2.0. I have attached the sample model.
Kindly tell how to fix the issue inorder to check the output with Freemaster tool V2.0
If you wish to test the Processor-In-The-Loop execution time with the dedicated Profiler Function Simulink Block then you don't have to use the FreeMASTER
Since PIL is a co-simulation between code that runs on Host PC and the code that runs on the actual HW, you could use the standard Simulink Scope to check the results - how much time the function needs to be executed.
All you have to do is:
1: add the Profiling function block in your PIL model
2: Configure the block to "Show Profile Output"
Then all you need to do in your harness test is to plot that PIL Profiler output.
For your particular model the result is shown below:
Your model contained some mistakes which i have corrected, check the attachement. If you want to learn more about PIL please check this video: Video Link : 7845
Are you looking for this kind of report?
For the moment that is not possible on PIL nor actual hardware. That is a function provided by MATLAB but was not yet enabled on existing toolboxes. For the PIL and actual HW application we can only show the actual execution cycles.
Nonetheless, you have a relative simple alternative: You could create subsystem for the functions you need to profile and add in each one a Profile Function. We can profile up to 100 function in a single run by changing the Profiler index.
Hope this helps!
I'm looking for code execution profile report like this.
For collecting the Profiling data there is an option in Code generation pane verification tab, Measure task execution time and Measure function execution times checkboxes has to be checked . But I'm getting Model error when simulation done. I have tried with your sample model also.
Herewith attached the error screenshot
Kindly confirm the reason.
Hi Sindhuja Bala,
I did confirm that in the previous reply :-)
For the moment that is not possible on PIL nor actual hardware.
For PIL/HW targets MATLAB provides an API that needs a HW timer implementation. In this case that API is left empty because we have not implemented yet that functionality. There are multiple issues in that regards especially when the timer overflows. We have done various tests and so far we did not found a reliable method to get timestamps from the real hardware. We are working with MATHWORKS team to find a resolution for such issues and hope we could enable such function in future releases.