This bug has been fixed in Release 2007b (R2007b). For previous product releases, read below for any possible workarounds:
Documentation on Configuring output ports of a block that are reusable in S function is missing from Simulink 6.5 (R2006b). This situation occurred because of the way the output port was configured. The output ports are explicitly set to be reusable. In this case, the output port memory will be accessed only during the outputs for that block. This is to enable 'Signal Storage Reuse'. The signal storage reuse option allows us to conserve memory being used around the model to pass signals, but the result is that the output port signals are not always available.
Instead of setting the output port the following way:
ssSetOutputPortOptimOpts(S, O_OUT1, SS_REUSABLE_AND_GLOBAL); /* enables use w/ merge blocks*/
Here is what it has to be to access the output during the update function:
ssSetOutputPortOptimOpts(S, O_OUT1, SS_NOT_REUSABLE_AND_GLOBAL);
Best Answer