Info

This question is closed. Reopen it to edit or answer.

Struct from nonvirtuell Bus

2 views (last 30 days)
Michael Silvanus
Michael Silvanus on 21 Aug 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello,
I wrote a Matlab System to communicate via a UART interface of the Raspberry Pi. I call the C-functions from the Matalb System with the coder.ceval command. The pidata_parse C-function returns the Data from the UART. For the In- and Ouput of the Matlab System I'm using a nonvirtuell Bus. out is the Name of the ouput.
If I try to do the following
out = coder.ceval(pidata_parse .....)
Matlab tells me to pre-initialsize the output. So I did the following:
out = struct{'a',0,'b',0 etc}
which works fine. Note: My Output will always be some kind of struct.
Evertime I change the Data thats coming in, I have to open up the System and change the strcut aswell as the definition of the nonvituell Bus. Is it somehow possible to create the struct depending on the entries of the Bus, so I only have to change the Bus setup ?.
Since I'm using the Support Package for Raspberry Pi I can't use the Simulink.Bus.createMATLABStruct command.
Thank you in advance Michael

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!