MATLAB: Am I unable to build an S-function with inherited sample time from a subsystem in Real-Time Workshop 6.1 (R14SP1)

builderrorinheriteds-functionsamplesimulink codersubsystemtime

I am trying to use the Real-Time Workshop S-function target to build an S-function from a subsystem. I want the S-function to inherit its sample time. When I compile the subsystem, I get the following error:
Error using ==> slbuild
Error using ==> RTW.makertw.make_rtw
Error using ==> tlc_c
Error using ==> rtwgen
This model will not inherit a sample time because a sample time was explicitly set in the model. This sample time was either set in a block or the fixed step size of the model.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
We have verified that there is a bug in Real-Time Workshop 6.1 (R14SP1) that occurs when you use the S-function target to build an S-function from a subsystem with inherited sample time.
To work around this issue, use a Model block instead of building an S-function.