Why is an error returned by Real-Time Workshop Embedded Coder 4.5 (R2006b) when I connect a constant block with "inf" sampling time to an output port in a Function call subsystem?

1 view (last 30 days)
The following error is returned when I build Sample.mdl using Real-time Workshop embedded coder 4.5 :
### Initial pass through model to cache user defined code
### Caching model source code
.
Error: File: C:\MATLAB_R2006b\rtw\c\tlc\mw\modelrefsfcnlib.tlc Line: 1904 Column: 3
Unable to find OutputUpdateTID0Fcn within the scope
Error: File: C:\MATLAB_R2006b\rtw\c\tlc\mw\modelrefsfcnlib.tlc Line: 1905 Column: 29
The left-hand side of a . operator must be a valid scope identifier
Error: File: C:\MATLAB_R2006b\rtw\c\tlc\mw\modelrefsfcnlib.tlc Line: 1908 Column: 34
The left-hand side of a . operator must be a valid scope identifier
Error: File: C:\MATLAB_R2006b\rtw\c\tlc\mw\modelrefsfcnlib.tlc Line: 1909 Column: 35
The left-hand side of a . operator must be a valid scope identifier
### Real-Time Workshop build procedure for model: 'Sample' aborted due to an error.
The error is not returned if the sample time for the constant block in the function call subsystem is changed to "-1".

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The output signals of the Function-call subsystem have been terminated instead of being connected to output ports in Sample.mdl. This is not recommended when the model-reduction option is turned on since it results in error messages that are hard to understand and make debugging difficult. When these termination blocks are changed to output ports and the model is updated the following error is returned:
'Sample/Function-Call Subsystem/Atomic Subsystem' may not be wired directly to the subsystem outport because it has a constant sample time on output port 2.
This error is expected since the Function-Call subsystem cannot have an output port with a constant sample time since the subsystem may not even be called at every time instant ( since by its very nature it is invoked only at a function-call). Changing the sampling time of the constant block to "-1" is the correct approach.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2006b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!