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!