Hello,
I've been having a problem with the C-Caller block in that it always thinks my function argument is an output. The function accepts a pointer to a structure and outputs a calculated result. Here's the function declaration and the definition of the input structure that it uses:
typedef struct
{
unsigned char data[10];
unsigned short numbytes;
} CRC_In;
unsigned short Calc_CRC(CRC_In* input);
The "C-Caller" block accepts the function ok, but insists on defining CRC_In* as an Output in the 'Port Specification'. Although this can be manually changed to 'Input' from the drop-down list, clicking on 'Apply' sets it back to 'Output'. Please could anyone suggest how to tell Simulink that the function argument is an input and not an output?
On a probably related note, when I try to compile the model, I get the error message 'Need to specify the exact size of the output argument 'in0' for the C Caller block'. I would have expected Simulink to be able to work out the structure size from its typedef declaration. Why is this not so?
Thanks,
John.