I am trying to pass 6 integer values out of a C Function into a variable in Simulink. I am trying this by trying to return a pointer to a fixed size array out of a C Function using the ceval function. I am having trouble with the ceval settings.
My C function is something like...
int * read_variable(void)
{
/*Static Variable for Counters */
Static int var[6];
/*Read and Assign to Array*/
var[0] = 10U;
var[1] = 11U;
var[2] = 12U;
var[3] = 13U;
var[4] = 14U;
var[5] = 15U;
/* Return point to the array */
return var;
}
What do I need in ceval to get this to work? Below is what I am starting with, but I am hoping someone else has already figured this out.
function var = read
var = int32(zeros(6,1));
var = coder.ceval('read_variable',coder.wref(var));
end