I am trying to compile a Matlab function to C. Here you have the declaration of the function:
function [SpdLmt0, SpdLmt1, SpdLmt2, SpdLmt3, SpdLmt4, SpdLmt5, SpdLmt6,
SpdLmt7, SpdLmt8, SpdLmt9, SLDst0, SLDst1, SLDst2, SLDst3, SLDst4,
SLDst5, SLDst6, SLDst7, SLDst8, SLDst9, IntTyp1, IntTyp2,
IntTyp3, IntTyp4, IntTyp5, IntTyp6, IntTyp7, IntTyp8, IntTyp9,
IntTyp10, IntDst1, IntDst2, IntDst3, IntDst4, IntDst5, IntDst6,
IntDst7, IntDst8, IntDst9, IntDst10, StpDst1, StpDst2, StpDst3,
StpDst4, StpDst5, StpDst6, StpDst7, StpDst8, StpDst9, StpDst10,
BumpDst1,BumpDst2,BumpDst3,BumpDst4,BumpDst5,BumpDst6,BumpDst7,
BumpDst8,BumpDst9,BumpDst10,SlopeVal1,SlopeVal2,SlopeVal3,SlopeVal4,
SlopeVal5,SlopeVal6,SlopeVal7,SlopeVal8,SlopeVal9,SlopeVal10,
SlopeDst1,SlopeDst2,SlopeDst3,SlopeDst4,SlopeDst5,SlopeDst6,
SlopeDst7,SlopeDst8,SlopeDst9,SlopeDst10,Radius1,Radius2,Radius3,
Radius4,Radius5,Radius6,Radius7,Radius8,Radius9,Radius10,CurvDst1,
CurvDst2,CurvDst3,CurvDst4,CurvDst5,CurvDst6,CurvDst7,CurvDst8,
CurvDst9,CurvDst10,UDP_error] = parser(UDP, longitud)
So I receive UDP data from a "UDP Receive" Simulink block for LINUX. The received message is composed by 100 data (the outputs of the function) codified in ASCII Code. My function "parser" takes the UDP message and decodifies it to have the desired outputs. The problem is when I try to compile it with the Simulink Coder I have this message:
Error: Errors occurred - aborting
Someone can help?
Without more information about the function, it's hard to know exactly what might be happening, but one recommendation is that you adjust the function call itself a bit. With that many return values, it's entirely possible that MATLAB Coder encountered an error in converting the function. It's pretty unusual to have that many return values, and it may cause problems.
I would suggest putting your return values into a single data structure (a struct or an array depending on what is appropriate). This would simplify your function call and perhaps help Coder out.