Develop and Deploy S-Function Blockset Using Blockset Designer
This example shows how you can collaboratively develop and organize your S-functions into a blockset, build the S-functions, create tests and documentation, and deploy the blockset using Blockset Designer.
A blockset is a user-defined collection of blocks organized in a Simulink® library that enables collaboration, deployment, and reuse of block libraries and blocks for your specific application. Use Blockset Designer to develop, organize, and maintain your S-function blockset artifacts, such as source codes, TLC files, build scripts, tests, libraries, models, and documentation.
Open the S-Function Blockset Designer project
The s-functions are grouped into sublibraries within the blockset. Use the Blockset Browser pane to view the details of the blockset, sublibraries, and its constituent blocks. For more information on organizing your blockset, see Create a Blockset Project. Blockset Designer is a Simulink® Projects-based tool that helps you organize your work by enabling collaboration on a single platform. For more information on projects, see What Are Projects?.
Build, Test, and Document S-Function Blocks
Consider the VariablePulseDelay S-function block within the ZeroCrossing sublibrary. Open the block page from the Blockset Browser.
The block page displays the build, test, and documentation configuration for the block. All paths to artifacts are specified relative to the root folder of the blockset designer project.
Specify the S-function source file in the S-Function File field and the build script in the S-Function Build Script field. Click Browse to open and modify these files. Select the Build checkbox and click Run to generate the S-function MEX file for this block.
You can specify the Harness Model and Test Suite used for testing your S-function block. Additionally, add documentation for your block using an MLX
file. Select the Test and Document checkbox and click Run to run the S-function tests and generate documentation for this block.
For more information about adding block artifacts, see Create and Organize Block Artifacts.
Deploy the Blockset
After developing, testing, and documenting the blocks within your blockset, publish the blockset as a toolbox for deployment. To publish your blockset, select the blockset project on the Blockset Browser and click Publish Toolbox button on the toolstrip.