Syntax
bht=smbSysPortLineTable(SName)
Input Parameter
Output Parameter
Copyright 2016-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, smbSysPortLineTable
, is designed to return a table of blocks and their port connections within a SimMechanics model. The function is authored by Tim Lueth and was created on November 11, 2016.
Input Parameters
- SName: The name of the SimMechanics system or model. If not provided, the function defaults to the current system using
gcs
(get current system).
Output Results
- bht: A cell array containing information about each block and its port connections.
Algorithm Steps
- Check if the input parameter
SName
is provided. If not, set SName
to the current system using gcs
.
- Use
find_system
to get all blocks in the specified system SName
with a search depth of 1, meaning only top-level blocks are considered.
- Determine the number of blocks
nb
and initialize a cell array bht
with nb
rows and 6 columns.
- For each block, store the block name and its handle in the first two columns of
bht
.
- For each block (starting from the second block), retrieve the port handles using
get_param
and store the left and right connection handles in columns 3 and 4 of bht
.
- Retrieve the port connectivity information and concatenate the port types into a string
t
.
- Determine the left and right port types by searching for
'/L'
and '/R'
in the string t
. Store these in columns 5 and 6 of bht
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:33. (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