Syntax
PMIO=smbfindPMIOPort([SName,renam])
Input Parameter
SName : | | subsystem name |
renam : | | if true the 2020a names are converted into 2018a names |
Output Parameter
PMIO : | | names of the PMIO Ports |
Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, smbfindPMIOPort
, is designed to find and optionally rename the PMIOPort blocks within a specified Simulink subsystem. It is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
- SName: The name of the subsystem where the PMIOPort blocks are to be found.
- renam: A boolean flag indicating whether the PMIOPort names should be converted from the 2020a naming convention to the 2018a naming convention. If true, the renaming process is executed.
Output
- PMIO: A list of names of the PMIOPort blocks found within the specified subsystem.
Algorithm Steps
- Retrieve the subsystem name (
SName
) and the renaming flag (renam
) from the input arguments using the getfuncparams
function. If not provided, default values are used: the current system for SName
and false
for renam
.
- Use the
find_system
function to locate all blocks within the specified subsystem (SName
) at a search depth of 1. This limits the search to the immediate blocks within the subsystem.
- Retrieve the block types of the found blocks using the
get_param
function.
- Identify which blocks are of type 'PMIOPort' using the
ismemberincell
function.
- Store the names of the PMIOPort blocks in the
PMIO
variable.
- If the
renam
flag is true, iterate over each PMIOPort block and rename it to follow the 2018a naming convention ('Conn#'). The set_param
function is used for renaming.
- After renaming, the function recursively calls itself to update the
PMIO
list with the new names.
Algorithm explaination created using ChatGPT on 2025-08-19 08:03. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21