4

How to write comments beside the simulink blocks ... is it possible to have text blocks or mouse over for the simulink as I need it for teaching my friend online and also for further self reference?

Raja Tejas
  • 43
  • 1
  • 3

2 Answers2

5

Please look at this article's page15 (i advice CTRL + F and search for 'comments')

The article states that "You can add text comments anywhere in the block diagram by double clicking and typing in some text"

Hope this helps, and remember Google is your friend.

Lyuben Todorov
  • 15,392
  • 6
  • 46
  • 67
  • This article was useful to me so thanks for the link. I am always looking for 'Simulink for Dummies' (by which I mean myself, not the OP) and wish there was such a book. – KAE Mar 26 '12 at 13:35
2

There are several ways to enter comments. If the comment is on the "whole" model and is containing a good chunk of text (e.g. documenting the function or tracing to Software Functions in the requirements) - Include a Doc Block.

The Doc Block will allow you to put in a lot of stuff and the text can be extracted later by a reporting tool, or just double clicked for browsing. The RTF variant also allows for formatting.

For small annotations to the model that are not related to a particular block; double click and you get a model annotation block. After you have filled this with text you can format it (color, drop shadow) to your liking and move it around.

For important comments and information about a particular block, I recommend you open the properties of the block and fill in the Documentation tab. If it is a relatively short comment, you can then also show this text next to the block by going to the "Block Annotation" tab and adding %. (You will also find tons of other useful things to print out in this list, e.g. initial values and other important parameters). These comments move with the block which reduces chance of misplaced comments.

An additional nice feature of filling in block documentation is that these comments can be made to appear in generated code next where the block is implemented.

Finally, one of the most powerful ways of commenting in Simulink: Choose your block names carefully!!!

The block name will often appear in generated code as comments or even as variable names, it will also appear in most error/debug printouts. Thus you can save yourself and others tons of time if the block name is descriptive. Even for blocks where you usually hide the name I would recommend naming them in the Model Explorer for this reason.

ErikP
  • 161
  • 8