1

I'm developing a system control in simulink and I'd like to run this model on embedded board. So, I'd like to link the inputs and outputs of model with specific functions (written by hand and outside of the model).

For understanding: I have an input that is an array of 8 elements. The pointer of this array is returned by a function called adc.readAllValues().

How can interface simulink with my external code?

1 Answer 1

0

This is an approach:

  • Inputs to Simulink are Simulink.Parameter objects

  • Outputs to Simulink are Simulink.Signal objects

These Simulink objects all have 'ExportedGlobal' storage class. Meaning they are global symbols that can be accessed from your external code. For example, in VxWorks you can use "symFindByName" to find out the address of the symbols.

An interesting Simulink feature that could help is C API http://www.mathworks.ch/ch/help/rtw/ug/data-exchange.html?searchHighlight=capi#f75428

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.