开发者

Model in the loop testing of C code in Matlab/Simulink

开发者 https://www.devze.com 2023-01-18 19:52 出处:网络
I make a distributed embedded application that will make use of several micro-controllers. The unit under control is a mechanical unit that I do not have, but I have a Simulink model of it. What are t

I make a distributed embedded application that will make use of several micro-controllers. The unit under control is a mechanical unit that I do not have, but I have a Simulink model of it. What are the possibilities to perf开发者_Python百科orm Model-in-the-loop testing of existing C code with minimum modification of it?


Integrating Existing C Functions into Simulink Models with the Legacy Code Tool offers an approach.


You could use the Real-Time Workshop package for Simulink to generate C code that implements the mechanical model, and then compile the generated code along with your existing C code. So, the mechanical model would execute on the microcontroller, with the model's inputs and outputs being "connected" to the existing control code.

This would probably also need the Embedded Coder to be able to target the exact microcontroller architecture, and to produce more efficient code.

0

精彩评论

暂无评论...
验证码 换一张
取 消