MATLAB: Does Real Time Workshop create a variable for each DWork vector, instead of only for the specified one, when using the %roll directive

directivedworknamerollsimulink coderspecifictlcvector

In the 'Target Language Compiler Directives' section of the Real Time Workshop documentation, it is mentioned that '<DWork>/name' must be used for the definition of 'rollVars' (roll variables) to create the roll structure for a specific DWork vector, 'name'. However, when I use this directive, a variable is created for every DWork vector present in the block instead of only for the specific DWork vector.

Best Answer

This change has been incorporated into the documentation in Release 2009a (R2009a). For previous releases, read below for any additional information:
There is a bug in the documentation for Real Time Workshop 7.1 (R2008a).
The line "<DWork>/name" in the documentation should read "<dwork>/name". When using "<DWork>/name", a variable is created for each DWork vector in the block similar to when "DWork" is used. However, if "<dwork>/name" (all lowercase) is used, then only the specified DWork vector will be assigned a variable.