Q: why does LCT needs the redundant simulink.bus object in the workspace if this information is already contained in the header files as a typedef struct?
A: Header files are used by c compilers. Matlab can not import or understand the struct definitions in c format. So it need a equivalent declaration in the form of Simulink.Bus object.
----------
Q: is my responsibility to guarantee that the headers and the simulink.bus objects are coherent with each other?
A: Yes you have to take care if you want to import the structure declaration from external header. OR simply do not use external header for defining structure. Instead generate the structure definition header from simulink (See last heading).
----------
Q: is there a way to convert from the header files to simulink.bus objects automatically?
A: You can write a matlab script to read the header file and generate the equivalent Simulink.Bus object.
----------
Best option for you:
If you do not want to write the definition at two places, simply set the DataScope field of Simulink.Bus object to Exported. This will force simulink to generate the structure definition header file from Simulink.Bus object.
Best Answer