A Pattern to Serialize a Simulink Bus.
15 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Kaustubha Govind
2012 年 10 月 10 日
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 件のコメント
Kaustubha Govind
2012 年 10 月 10 日
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
2016 年 8 月 1 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Model Editing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!