A Pattern to Serialize a Simulink Bus.
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi there,
I have the mother of Simulink busses. It contains other nested busses and just to make stuff interessting some arrays of busses. Ultimately I would like to send the buss over a UDP link.
My question is, "Is the a generic pattern to convert busses to a character stream?" Would I would not like is to change some blocks every time I change the bus definition or use S-functions or a MATLAB-function block.
For extra browny points the edianess of the data being streamed should be considered.
Thanx Petri
0 commentaires
Réponses (2)
Kaustubha Govind
le 10 Oct 2012
This may not work for you since you seem to have a non-virtual bus, but I just wanted to throw it out there. If you could convert your nonvirtual bus to a virtual bus, you might be able to utilize the Bus To Vector block. (Note: You mentioned using arrays of buses - these cannot be virtual AFAIK)
2 commentaires
Kaustubha Govind
le 10 Oct 2012
Petri: Perhaps you should use Data Type Conversion blocks to convert your bus elements to be all of the same type? There is no concept of a Simulink vector/matrix having mixed types (like cell-arrays in MATLAB).
Fabiano Silva
le 1 Août 2016
Hi Petri, I had a similar problem and couldn't find a way to serialize a Simulink non-virtual bus. My solution was extract the signals from the bus with a Bus Selector and then use a Byte Pack block to serialize them. I think it's not the better way to serialize the information in the bus, but it's working well.
0 commentaires
Voir également
Catégories
En savoir plus sur Interactive Model Editing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!