MATLAB: Generated code file name Suffixed with 0

code generationEmbedded Codergenerated filesMATLABsimulink

I am not having good time with 8.x Matlab release 🙁
Tons of problem.
One of the problem is, when I generated code from Simulink model, the generated files name and model data variables name are suffixed with 0.
I am using AUTOSAR Target Production Package 6.5.3. Model is imported from arxml and implementation is added. Whenever I am doing "Export function" for top level subsystem, code is being generated like this:
ModelName - XYX_abc.slx
TopLevel Subystem Name - abc
Generated code files: abc0.c, abc0.h, abc0_private.h, abc0_types.h
Same thing is happening if I generate code from command line using:
rtwbuild('XYX_abc/abc', 'Mode', 'ExportFunctionCalls');
I am using R2013b with Embedded Coder license.
Same thing I was doing with R2011b from last more than 3 years but never faced any such issue.

Best Answer

I had the same problem. In my case I had to change the file name so that it is different from the name of the toplevel subsystem in order to fix this.