# Guy and Seth on Simulink

## Smart Signal Routing

This week guest blogger Michael Carone is here to talk about improvements to signal routing in Simulink R2012b.

Smart Signal Routing

Has this ever happened to you: You have two blocks that you connect together and the signal line doesn’t show up where you want it to go? It overlaps a block or some text in the model, and then you have to move sections of the signal around in order to get it just right. It can get pretty frustrating – you start thinking “Why do I have to spend all this time fiddling around with signal lines just to make my model look good? Simulink should do this automatically!”

Line routing with an optimal path

Well, I have good news! The new Simulink Editor in R2012b does a much better job of drawing signal lines with one of my favorite new features, smart signal routing. What’s smart signal routing? Basically, it means that when you draw a signal line, Simulink will automatically find the “optimal path” so that the new signal line is as short as possible, has minimal 90 degree turns, and doesn’t overlap other blocks and text. Not only that, as you draw the signal line, Simulink lets you know exactly what the path is going to look like before you release the mouse button. So there are no surprises! (in this case, that’s a good thing).

Drawing custom paths

You might be thinking, “Automatic signal line? What if I want to create my own signal line paths?” The good thing is that there’s a new way to create your own custom signal line path too. Here’s how it works: Draw a signal line like you normally would. Then release the mouse button when you want to create a bend in the line. You’ll see three blue arrows appear: one to keep going straight and two to make a left or right turn. Choose the arrow that you want and repeat until you’ve created your own signal path. Here’s a little video to show how this works:

Minimum disturbance

Now what’s neat about this new signal line is that it won’t get blown away if you move some blocks around as you continue building up the model. Part of the smartness of the smart signal routing algorithm is to know when to leave a signal alone. It’s what we call “minimum disturbance.” In other words, the signal lines that already exist will be disturbed as little as possible as you move blocks around. Here’s another clip to show how this works:

Conclusion

Smart signal routing is just one of the many features added to the new Simulink Editor to make modeling easier.

Now it's your turn

Have you tried out the new Simulink Editor yet? What do you think of the new smart signal routing algorithm? Let us know by leaving a comment here!

### 5 Responses to “Smart Signal Routing”

1. KE replied on :

Good, eliminates a time waster and makes diagrams more legible. Maybe in the future there can be “smart” arrangements of the blocks as well.

2. lord replied on :

Thanks

3. Saber replied on :

God bless you! You solved one of my biggest problems!

4. Jason S replied on :

Good to see this; thanks Mathworks!

Could you comment about signal routing w/r/t nodes that connect an output O1 to more than one input (I1, I2, I3), so that there are branches in the routing?

One of my pet peeves is if I need to disconnect the node from the output O1 and connect it to another output O2, I can’t seem to do it without deleting the entire node.

Also the junction dot has been a pain to move around to keep it at the “obvious” place. Hard to describe this without a picture, but a junction should look like a T with the dot where the three lines meet. Instead the dot is often somewhere else to the side, and it’s cumbersome to move it to the proper place.

5. Jason G replied on :

Hi Jason,

The line routing is much better. For your scenario, you can now just grab the line at O1 and move it to O2. As you get the mouse close to the Output O1 the mouse cursor turns to a circle and you can grab the line and move it to somewhere else.
You should look at this post to help answer your question on junction dot. This too have been vastly improved in 12b:
Blog Post: You say “sȯ-dər”, I say “sōl-dər”

 Name (required) E-mail (required, will not be published) Website (optional) Spam protection (required): What is 3 + 7 ?

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>


If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).

Guy Rouleau and Seth Popinchalk are Application Engineers for MathWorks. They write here about Simulink and other MathWorks tools used in Model-Based Design.

These postings are the author's and don't necessarily represent the opinions of MathWorks.