Difference between revisions of "Creating a block in Simulink"
From OpenMBD
Line 26: | Line 26: | ||
<br> | <br> | ||
At this point, the block has been created successfully showing twelve input ports.<br> | At this point, the block has been created successfully showing twelve input ports.<br> | ||
− | [[File:new_block.PNG]] | + | [[File:new_block.PNG]]<br> |
By double-clicking the block, the user settable parameters are shown:<br> | By double-clicking the block, the user settable parameters are shown:<br> | ||
[[File:new_block_parameters.PNG]] | [[File:new_block_parameters.PNG]] |
Revision as of 19:35, 28 February 2019
With all files in place, a new block can be created.
- Open the Simulink Library Browser
- Drag-and-drop a Level-2 MATLAB S-Function into the project
- Right-click the block
- Select Mask -> Create Mask...
- Carefully copy the settings depicted in the following images:
- Type options:
SPI1: D11
SPI2: D34
- Callback:
- Click OK
- Right-click the block
- Select Block Parameters (M-S-Function)
- Fill in the parameters as follows:
- Click OK
- Change the block to a convenient size
At this point, the block has been created successfully showing twelve input ports.
By double-clicking the block, the user settable parameters are shown: