How to measure control law execution time in Launchxl-F28379D?

2 views (last 30 days)
Dear Sir or Madam,
I have implemented a digital control law in a Launchxl-F28379D using the Embeded Code Support for TI C2000 ProcessorsSimuli.
The control law is implemented inside an IRQ trigger function block between the AD and and the DA block.
How can I measure the execution time of this control law? I have used codertarget.profile.getData( ), but this gave me the exectution time for AD an DA but not in between.
In code composer source code we usually add a GPIO bit activation after getting AD value and GPIO bit deactivation after control law computation. This allows oscilloscope measurement. But I don't know how to do something simular in Simulink.
Can you help me?
Thanks in advance
With best regards.
Enric
codertarget.profile.getData('f28379D_AD_int')

Accepted Answer

Venkatesh Chilapur
Venkatesh Chilapur on 20 Mar 2019
Hi Enric,
Attached is the model which helps you to achieve the same in simulink w.r.t GPIO bit activation and deactivation. Few points to note: The subsystem which contains the algorithm for which we need to measure the execution time, needs to be defined as atomic. The GPIO pin Set and Clear operation are part of the 'System Outputs' block which will place the GPIO pin Set and Clear lines of code around the algorithm code that helps one to measure the execution time by measuring the GPIO ON time using a digital scope.
Hope this helps,
Regards,
Venkatesh C
  1 Comment
Enric Vidal Idiarte
Enric Vidal Idiarte on 21 Mar 2019
Hi Venkatesh,
Thanks for your answer.
It works very well.
Unitl now I did it modifying the source code in Code Composer, but with MATLAB it's
more usefel.
Lots of thanks
Regards,
Enric

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!