Share variables between two level 2 s-function blocks

2 次查看(过去 30 天)
Hello,
I am implementing a data process program im simulink. I have a interpolator(a c++ mex function) that creats a trajectory with inputing some 'via points'. I want to seperate this block into two parts. One is for computation, one is output the trajectory with a trigger and time scaler.
Now the issue is, block two need to get the result from block one. I don't want to make the trajectory as a input to block two. Is there some way that makes the output from block 1 accessible from block 2 ?
I have tried DWork vector, it works only in one block(for example, sharing variables between mdlstart and mdloutput). Alternative way I found is creat a dll library. But it's time consuming, is there a better way?
For simple, I just want to get the variable in test and have the same output in test2, like this figure.
Screenshot from 2019-08-13 11-34-31.png
(Both this two are integrated c++ s_functions)

回答(1 个)

Dinesh Yadav
Dinesh Yadav 2019-10-30
There are 2 methods only to solve your problem and both you already know either give a physical connection between the two blocks or create a .dll file.There is no other way. I would recommend using direct connection.

类别

Help CenterFile Exchange 中查找有关 Block and Blockset Authoring 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by