Simulink custom S-Function dynamic Bus types
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I'm implementing a custom block as C-function with one Bus input port and no output (it's meant as an interface sending messages to another system). The Bus can contain everything from one single number over some strings up to several nested buses. There are many different types of messages to be transferred via that bus, all represented by MATLAB structures. Therefor, I'd like to have a dynamic type of bus determined when the simulation starts rather than having to build a different block for each message type.
What I've done so far: I created both a block for creating and handling a Bus based on a nested MATLAB structure.
What I'd like to do now: Make the Bus handling block dynamic, so that a user can pass a pre-defined MATLAB structure name as parameter and the block logic automatically expects the corresponding Bus.
I am able to resolve the structure from its name and build a Bus object corresponding to it. What's missing is the dynamic exchangeability for the bus object that is expected by the block.
2 件のコメント
Kaustubha Govind
2014 年 6 月 10 日
Rob: Would it suffice to have an S-function parameter that the user can set to pass on the bus name to the underlying code? It seems to me like that should do it, but I'm not sure if I understand your usecase completely.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!