Main Content

Add Description for Users

In this procedure, you modify the System object™ developed inCreate a Digital Write Blockto 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 theMATLAB Systemblock.

  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.

    classdefDigitalWrite < 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 theCompilation Directive %#codegen(MATLAB Coder).

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

In the next section, you willAdd Pin Number Propertyto you System block mask.

See Also

|