This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Add Description for Users

In this procedure, you modify the System object™ developed in Create a Digital Write Block to include a description in the block mask. The first group of comments written at the start of System object class are automatically imported into the block mask of the MATLAB System block.

  1. In the MATLAB® Editor, open the System object class file, DigitalWrite.m.

  2. Replace the comments at the beginning of the class file with a description of the block.

    classdef DigitalWrite < matlab.System ...
            & coder.ExternalDependency ...
            & matlab.system.mixin.Propagates ...
            & matlab.system.mixin.CustomIcon
        %
        % Set the value of the selected GPIO pin on the harwdare board.
        % 
        %#codegen
        %#ok<*EMCA>
        
    ...
    end

    The first line of the comments becomes the message displayed inside the block mask.

    Note

    Do not remove the Compilation Directive %#codegen (MATLAB Coder).

  3. In your Simulink® model, double-click the DigitalWrite block to display the block mask. Confirm the description in the block mask matches the comments in the class file.

In the next section, you will Add Pin Number Property to you System block mask.

See Also

|