Syntax
s=smbNameofPort(b,ph)
Input Parameter
b : | | Block Name |
ph : | | Port Name used |
Output Parameter
Examples
Get the used connection for a known Port
a=smbGetConnectedBlocks(smbWhich('N4'))
smbNameofPort(a{2,3},a{2,4})
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, smbNameofPort
, is designed to determine the connection type of a specified port in a Simulink block. It is an auxiliary function used in conjunction with smbGetConnectedBlocks
.
Input Parameters
- b: The name of the block in the Simulink model.
- ph: The port handle, which is the identifier for the specific port whose connection type is being determined.
Output
- s: A string indicating the connection type of the port. It will be either 'RConn' followed by an index or 'LConn' followed by an index, depending on whether the port is a right or left connection.
Algorithm Steps
- Initialize an empty string
s
to store the result.
- Use the
get_param
function to retrieve the port handles of the block b
. This includes both right connections (RConn
) and left connections (LConn
).
- Iterate over each right connection (
RConn
) using a loop:
- Check if the current right connection handle matches the specified port handle
ph
.
- If a match is found, set
s
to 'RConn' followed by the index of the connection.
- Iterate over each left connection (
LConn
) using a loop:
- Check if the current left connection handle matches the specified port handle
ph
.
- If a match is found, set
s
to 'LConn' followed by the index of the connection.
- Return the string
s
which indicates the connection type of the port.
This function is useful for identifying the specific connection type of a port within a Simulink block, which can be critical for understanding the block's connectivity in a model.
Algorithm explaination created using ChatGPT on 2025-08-18 23:18. (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