I am just back and "setting up" my flat again!
malife wrote:I wonder what the global input parameter does in the C-Function call
The Global Input Size
parameters set all input with the defined size.
If that size is 1, each input is considered as a scalar. (Simulink call the function with the value as parameter)
If that size is greater than 1, each input is considered as a vector. (Simulink call the function using pointers)
From the function call block point of view, there is no difference if the input size is 2 or 100. The pointer provided by Simulink is taken as is.
I can propose few independent solutions that you perhaps already tested:
- change the optimization option of the real time workshop (like "reuse signal").
- use the input of the C call function with 3 independent vector input (i.e. size of the global input Size parameter greater than 2) and mux the three input in the C function.
- Set the output of the GPS parser block with a size of 46 (so the 20 last bytes are not used) and use the Simulink standard block that can fill in a vector starting at a defined index (here 21 for the 2nd input and so on...)
It is not clear to me how Simulink mux vectors and if the RTW optimization parameters change the way it do it. I will look at that as soon as I unpack my computer (I am using the old vacation laptop that does not like matlab at all
To have a close look on theses bugs, it is always helpful to get model with the bug. I would be glad if you could send it (or a simplified version with the same bug!)