I don't know if this 2002 discussion is still relevant, but possibly you just can't do that: seethis
It is difficult to find useful information about dSpace on the Mathworks web site.
The message you are encountering means that somewhere in there you have a Level-2 S function that you are trying to generate code for, OR you are trying to generate code for a Simulink block that they did not provide compilation information for. In order to generate code for the missing piece, you have to provide aTarget Language Compiler file.
Best Answer