integrate C code in block simulink for C2000

Hi to all,
I wrote some functions in C language to read the registers of C2000 and to monitor their status.
I would like to integrate this C code in a block simulink.
How do I integrate this C code in simulink?
There are examples of this integration ?
I am using MCU F28035 Piccolo and Matlab 2014a
Best Regars,
Dario Detomaso

回答 (3 件)

Titus Edelhofer
Titus Edelhofer 2014 年 12 月 23 日

0 投票

Hi Dario,
take a look at the following point in the doc:
You will need to write an S-function for this. There are a larger number of examples, often the S-Function Builder is a good starting point since it guides you through the different things you need to specify (number of in- and outputs, sample time etc.).
Titus
Detomaso
Detomaso 2014 年 12 月 26 日
編集済み: Detomaso 2014 年 12 月 26 日

0 投票

Hi titus ,
i want to read / write some registers of C2000 in simulink. For example in a simulink block , I would like to do this :
GpioDataRegs.GPASET.all =0xAAAAAAAA;
GpioDataRegs.GPACLEAR.all =0x55555555;
GpioDataRegs.GPBSET.all =0x0000000A;
GpioDataRegs.GPBCLEAR.all =0x00000005;
how could I do?
Best Regards,
Dario

1 件のコメント

Titus Edelhofer
Titus Edelhofer 2015 年 1 月 5 日
Hi Dario,
this will be difficult with S-Function builder. In this case you will need to write a .tlc file. Note: this is documented how to do but not really simple, admittedly ... MathWorks Consulting does help with those kind of problems/requests.
Titus

サインインしてコメントする。

Patxi
Patxi 2016 年 5 月 4 日

0 投票

Hello Dario, I'm also interested in programming this controller in Simulink. Did you finally get to solve it with S-Function Builder modules? Thanks Patxi

質問済み:

2014 年 12 月 22 日

回答済み:

2016 年 5 月 4 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by