How to run a task/function using MBDT on Matlab/Simulink?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to run a task/function using MBDT on Matlab/Simulink?

2,268件の閲覧回数
rolo90
Contributor I

Hello everyone,

I wonder how can you allocate a task or function to run in the background loop using NXP MBD toolbox on Matlab/Simulink? Can this functionality be added?

Thanks,

Rolando

 

0 件の賞賛
返信
3 返答(返信)

2,250件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @rolo90 ,

MBDT generates bare-metal code so no RTOS is used. If you want to add a function to be executed periodically, you have to use a timer, for example PIT to trigger periodically the code you need.

Hope this helps,

Marius 

0 件の賞賛
返信

2,244件の閲覧回数
rolo90
Contributor I

Hello @mariuslucianand 

I want the function to run on the infinite while loop. I am aiming for something like this: 

int main()

{

      while(1) {

      MyFunction();

      }

}

Is it possible?

Thanks,

 

Rolando

0 件の賞賛
返信

2,212件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello Rolando,

the only way in which this can be done, is to open the mbdtargetmainlibs32k.tlc attached in the toolbox, look inside that file and add your function name in the following location. Then insert your function with custom code.

mariuslucianand_0-1625054226816.png

Hope this helps,

Marius