Technical Articles and Newsletters

Tips and Tricks: Smart Signal Routing in Simulink

By MathWorks

With smart signal routing, Simulink® automatically finds the shortest path that has the fewest 90-degree turns, without overlapping other blocks or text. Not only that, but as you draw the signal line, Simulink shows you exactly what the path will look like before you release the mouse button. You get real-time feedback, and there are no surprises.

Simulink model with smart signal routing enabled. Smart signal routing automatically finds a “smart” path from block to block.

Custom Signal Paths

Smart signal routing has significantly improved the automatic signal routing algorithms used in Simulink; however, there are still times when you want to draw a signal path yourself so as to precisely determine the shape of the line. Smart signal routing can help here, as well. This is how it works: Draw a signal line. To create a bend in the line, release the mouse button. Three blue arrows appear, one pointing straight ahead, one left, and one right. Choose the direction that you want the signal line to follow, and repeat the process until you’ve completed the path.

Custom signal path created using smart signal routing. Custom signal paths give you precise control over the shape of the signal line.

Minimum Disturbance

Part of the “smartness” of the smart signal routing algorithm is that it operates on the principle of minimum disturbance—that is, it changes the shape of existing signal lines as little as possible as you make changes to the model. This is especially important when you have taken the time to create a custom signal path; you do not want that entire path to get redrawn when another block is moved.

In some cases, tiny kinks can appear in the signal line, especially if the model was created in Simulink R2012b or earlier. In those instances, simply move the connected blocks. This automatically removes the kinks, giving you a cleaner-looking model.

Published 2013 - 92136v00

View Articles for Related Capabilities