Model in the loop testing of C code in Matlab/Simulink
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.
精彩评论