I have a C-code function that takes in an array and a size value. I am trying to call the function in Stateflow and I am not having any success no matter what I try. I did add the appropriate includes to the C-code in the model config under simulation target/custom code. The only way I can get Stateflow to update/compile is when I change the C-code to not take in an array, but just a single element.
This is the function call I am trying to use:
The function ElbowFindFxn() works as a Simulink custom code block, if finds and uses the external C-code just fine.
The variable vecV is defined as a 100 element float array (max size, use less than that in practice). I've tried passing in the array in multiple different ways:
&vecV[0]
(float*)vecV
vecV[] - this gave a syntax error right away, but was worth a shot
and a few others I don't remember.
I even tried putting the function into a Stateflow graphical function.
For the most part I don't get just a single error, but the compiler seems to blow up and spill its guts.
I know it's not the C-code, because that code has worked just fine in other applications, and in Simulink custom code block.