How can I generate an empty file and function using Real-Time Workshop which can be populated later by user’s custom code?

Using the code generation I want to generate an empty file with empty function to be populated by me later.
RTW optimizes the empty subsystem. I do not want that to happen.

 Accepted Answer

User can achieve this using atomic subsystem. Please see an example model attached.
Please follow the steps below:
1. Use atomic subsystem block on your model. Keep it empty as shown in the model attached.
See doc for Atomic subsystems,
2. Right click the block and select ‘Subsystem Parameters’.
3. Then do following settings,
-- For ‘Real Time Workshop system code’ select ‘Reusable function’. (Default is Auto)
-- For ‘Real Time Workshop function name option’ select ‘User Specified’.
-- Enter the name for the function in the text box that appears.
-- For ‘Real Time Workshop file name option’ select ‘User Specified’.
-- Enter the name for the file to be generated for the atomic subsystem.
4. Generate the code.

More Answers (0)

Categories

Products

Release

R2009b

Community Treasure Hunt

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

Start Hunting!