Simulink custom S-Function dynamic Bus types
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Kaustubha Govind
le 10 Juin 2014
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Block Authoring Basics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!