Vladimir Keleshev
Vladimir Keleshev

Reputation: 14245

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 perform Model-in-the-loop testing of existing C code with minimum modification of it?

Upvotes: 2

Views: 1653

Answers (2)

sblair
sblair

Reputation: 1085

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.

Upvotes: 0

Related Questions