Main Content

DocBlock

Create text that documents model and save text with model

  • DocBlock

Libraries:
Simulink / Model-Wide Utilities
HDL Coder / Model-Wide Utilities

Description

The DocBlock allows you to create and edit text that documents a model, and save that text with the model. Double-clicking an instance of the block creates a temporary file containing the text associated with this block and opens the file in an editor. Use the editor to modify the text and save the file. Simulink® software stores the contents of the saved file in the model file.

The DocBlock supports HTML, Rich Text Format (RTF), and ASCII text document types. The default editors for these different document types are

  • HTML — Microsoft® Word (if available). Otherwise, the DocBlock opens HTML documents using the editor specified on the Editor/Debugger Preferences pane of the Preferences dialog box.

  • RTF — Microsoft Word (if available). Otherwise, the DocBlock opens RTF documents using the editor specified on the Editor/Debugger Preferences pane of the Preferences dialog box.

  • Text — The DocBlock opens text documents using the editor specified on the Editor/Debugger Preferences pane of the Preferences dialog box.

Use the docblock command to change the default editors.

Tip

To edit the block parameters of the DocBlock, right-click the block icon and select Mask > Mask Parameters....

Examples

expand all

This example shows how to use a DocBlock to capture information about a model. In the sldemo_fuelsys model, a DocBlock labeled Sensor Info is used to document measurement descriptions inside of the To Controller subsystem.

Parameters

expand all

Enter a template symbol name in this field. Embedded Coder® software uses this symbol to add comments to the code generated from the model. For more information, see Add Global Comments in the Generated Code (Embedded Coder).

Dependencies

For comments to appear in the generated code, you must also set the Document type to Text.

Programmatic Use

Block Parameter: ECoderFlag
Type: character vector
Values: 'Abstract' | 'Description' | 'History' | 'Modified History' | 'Notes'
Default: ''

Select the type of document associated with the DocBlock. The options are:

  • Text

  • RTF

  • HTML

Dependencies

If you are using a DocBlock to add comments to your code during code generation, ensure that you set the Document Type as Text. If you set the Document Type as RTF or HTML, your comments will not appear in the code.

Programmatic Use

Block Parameter: DocumentType
Type: character vector
Values: 'Text' | 'RTF' | 'HTML'
Default: 'Text'

Block Characteristics

Data Types

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Version History

Introduced before R2006a

See Also

Blocks

Functions