Contenido principal

spsConversionFindBlocks

Find Specialized Power Systems library blocks inside model

Since R2025b

Description

Note

For more information about upgrading Specialized Power Systems models, see Upgrade Specialized Power Systems Models to use Simscape Electrical Blocks.

blockTable = spsConversionFindBlocks(modelName) finds all Specialized Power Systems library blocks used in the modelName model, its subsystems, and any models referenced by it, including all variants. The function returns a blockTable table that contains the Model Block, Library Block, and Library variables.

example

blockTable = spsConversionFindBlocks(modelName,Name=Value) specifies additional options using one or more name-value arguments.

Examples

collapse all

This example shows you how to search for Specialized Power Systems library blocks in a model by using the spsConversionFindBlocks function.

Open the model you want to search for Specialized Power Systems blocks.

open_system("myModelName");

Graphical representation of the myModelName model in this example.

The model in this example comprises one subsystem named Subsystem_1 that contains two Specialized Power Systems blocks named NameSPSBlock_1, NameSPSBlock_2, two additional Specialized Power Systems blocks named NameSPSBlock_3 and NameSPSBlock_4, and one Simscape block named NameSimscapeBlock.

Use the spsConvesionFindBlocks function to obtain a table that lists all the Specialized Power Systems blocks in the model, including the blocks inside subsystems.

spsBlocksTable = spsConversionFindBlocks("myModelName");
Model contains Specialized Power Systems library blocks.

spsBlocksTable =

  4×3 table

                  Model Block                                   Library Block                             Library         
    ________________________________________    _____________________________________________    _________________________

    "myModelName/NameSpsBlock_4"                "libraryName1/SpsBlock_4"                         "libraryName1" 
    "myModelName/Subsystem_1/NameSpsBlock_1"    "libraryName2/SpsBlock_1"                         "libraryName2"           
    "myModelName/Subsystem_1/NameSpsBlock_2"    "libraryName1/SpsBlock_2"                         "libraryName1"
    "myModelName/NameSpsBlock_3"                "libraryName3/SpsBlock_3"                         "libraryName3"

The table comprises these variables:

  • Model Block — Name of the block in the model

  • Library Block — Name of the block in the library

  • Library — Name of the library

Input Arguments

collapse all

Name of the model to search for Specialized Power Systems blocks, specified as a character vector or string scalar. The model must be loaded or on your MATLAB® search path. Alternatively, specify the original model name as a character vector or string scalar that contains an absolute or relative path name.

Example: "myModelName"

Example: "C:\Work\myModelName.slx"

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: table = spsConversionFindBlocks("myModelName",FollowLinks="on")

Option to search for Specialized Power Systems blocks under masked subsystems, specified as:

  • 'none' — Search skips masked subsystems.

  • 'all' — Search includes all masked subsystems.

  • 'functional' — Search includes masked subsystems that have icon drawing commands or mask initialization commands without having parameters, description, help strings, and UI elements.

  • 'graphical' — Search includes masked subsystems that have only icon drawing commands without having workspaces, dialogs, help strings, and UI elements.

Option to follow links of linked blocks up to the parent library blocks, specified as "on" or "off".

For more information about libraries and linked blocks, see Libraries and Blocksets and Linked Blocks.

Output Arguments

collapse all

Table describing the Specialized Power Systems library blocks that the function found in the specified model, returned as a table. The table comprises these variables:

  • Model Block — Name of the block in the model

  • Library Block — Name of the block in the library

  • Library — Name of the library

If the model does not contain any Specialized Power Systems blocks, the table is empty.

Version History

Introduced in R2025b