SinkAutoConnect
by Mike Anthony
07 Sep 2010
(Updated 21 Oct 2010)
Automatically connects single-inport blocks when block is dropped over a line in Simulink.
|
Watch this File
|
| File Information |
| Description |
Unlike SISO block in Simulink, blocks that have a single inport and no outport (Scope, Display, To File, To Workspace) do not autoconnect if dragged over a line in a model. Placing a call to this function in the CopyFcn callback of any single-inport block will cause the block to automatically connect when the block is dropped over a line in a Simulink model. This is similar to the built-in behavior of SISO blocks (ie gain, unit delay, etc) in Simulink. These blocks, when dropped on a line, automatically connects the inport and outport. With this function, in this case of a single-inport block, the block is moved just below the line and the inport is automatically connected.
This can be made the default behavior for these blocks by creating a custom library containing the desired blocks and adding the call to this function in the CopyFcn callback of the library blocks. |
| Acknowledgements |
This file inspired
Auto Connect.
|
| Required Products |
Simulink
|
| MATLAB release |
MATLAB 7.11 (R2010b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 10 Sep 2010 |
Removed instructions on how to alter the built-in Simulink library blocks. |
| 15 Sep 2010 |
Added Copyright comment in SinkAutoConnect.m |
| 20 Oct 2010 |
10/20/2010 Added:
1. Bug fix for when copying a block not onto a line.
2. Equivalent capability for MoveFcn callback
|
| 20 Oct 2010 |
Bug fixes and equivalent capability for MoveFcn callback |
| 21 Oct 2010 |
Updated to fix bugs, work in the MoveFcn callback, and work for sink blocks with multiple inports (like the XY Graph). |
|
Contact us