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.
解決済! 解決策の投稿を見る。
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.
Hope this helps!
Regards,
Stefan.
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.
Hope this helps!
Regards,
Stefan.
Thank you for the detailed explanation, this information will help to me.
Best wishes.