I'm trying to achieve the following behavior: I have a Simulink block that must perform encoding of multiple Bus Objects.
The block has been coded in C++ using the S-Function notation (not the S-function builder). I would expect the output to be dynamically sized, i.e., according to the Bus Object that is fed into the input port, the Output Size is set. However, I am not able to do this since, when running the ssInitializeSizes function, the Data Type of the input port appears unknown. In particular, a DataIdx of -1, corresponding to the 'auto' type, is returned.
Note that this behavior for the Data Type is then solved later on during the simulation. Indeed, if I determine the dataIdx and Name during the simulation, the data and Bus object name is properly identified (and this allows me to customize the encoding logic using properly-developed C++ templates).
Is there any way to determine the Data Type before the data sizes have been set?
I understand that I could also work using variable output sizes; however, this forces me to have a fixed sample time for this block.