Outport affect to the CPU usage

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Outport affect to the CPU usage

ソリューションへジャンプ
562件の閲覧回数
aslan_eyyup
Contributor II

For the simscape battery SOC estimation example, when using the outport for SOC monitoring in the PIL block with MPC5775E, the CPU usage is ~0.153%. But When I terminate it and don't monitor the SOC, CPU usage from PIL block becomes ~0.000208%. In this case I am not sure if the algorithm works without outport but I am wondering about your comments. Thanks.

aslan_eyyup_0-1678287848465.png

aslan_eyyup_1-1678287884771.png

 

 

タグ(3)
0 件の賞賛
1 解決策
501件の閲覧回数
stefancinipeanu
NXP Employee
NXP Employee

Hi @aslan_eyyup 

The reason why CPU usage drops from 0.15% to 0.002% is because Simulink Coder optimizes the generated code. In this matter, when in PIL mode, if you terminate the model inside the PIL subsystem, the code corresponding to your model will not be generated and so the CPU has nothing to execute.

In the attached picture, you can see the differences between PIL subsystem generated code when using the output port and when using the terminator. When using the terminator, the code for the SOC Kalman Filter is not generated due to Simulink optimizations.

stefancinipeanu_0-1679565990600.png

Hope this helps!

Regards,

Stefan.

 

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
502件の閲覧回数
stefancinipeanu
NXP Employee
NXP Employee

Hi @aslan_eyyup 

The reason why CPU usage drops from 0.15% to 0.002% is because Simulink Coder optimizes the generated code. In this matter, when in PIL mode, if you terminate the model inside the PIL subsystem, the code corresponding to your model will not be generated and so the CPU has nothing to execute.

In the attached picture, you can see the differences between PIL subsystem generated code when using the output port and when using the terminator. When using the terminator, the code for the SOC Kalman Filter is not generated due to Simulink optimizations.

stefancinipeanu_0-1679565990600.png

Hope this helps!

Regards,

Stefan.

 

0 件の賞賛
488件の閲覧回数
aslan_eyyup
Contributor II

Thank you for the detailed explanation, this information will help to me. 

Best wishes. 

0 件の賞賛