smbfindPMIOPort

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-25, Last change: 2025-09-14

finds and renames the SimScape PMIOPort of a subsystem

Description

While before 2020, automatically when creating a subsystem, the subsystems ports (PMIOPort) were called Conn#, In 2020 the PMIOPort get their name wrt to ??????
smbfindPMIOPort is called only by smbConvertSubsystem

See Also: smbConvertSubsystem , smbCreateSubsystem , smbCreateSG , smbCreateSGJoint

Example Illustration

 missing image of smbfindPMIOPort(SName,renam)

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

Output

Algorithm Steps

  1. 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.
  2. 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.
  3. Retrieve the block types of the found blocks using the get_param function.
  4. Identify which blocks are of type 'PMIOPort' using the ismemberincell function.
  5. Store the names of the PMIOPort blocks in the PMIO variable.
  6. 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.
  7. 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