Syntax
smbLogOutputPort(block,Nr)
Input Parameter
block : | | Block |
Nr : | | Output Port Number |
Examples
Try a simulation
VLFL_EXP20;
smbAddFrameSensor('LINK4.RF');
simOut=smbSimulate(1);
[T,t]=smbTofSimOut(simOut,'LINK4.RF');
whos T
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, smbLogOutputPort
, is designed to activate data logging for a specific output port of a Simulink block. It is part of the SimMechanics library and was created by Tim Lueth in December 2016.
Input Parameters
- block: The Simulink block for which the output port data logging is to be activated. If this parameter is empty, the function uses the current block (
gcb
).
- Nr: The number of the output port that needs to be logged.
- varargin: An optional parameter that can be used to specify a custom signal name for the output port.
Algorithm Steps
- Check if the
block
parameter is empty. If it is, set block
to the current block using gcb
.
- Construct a default signal name using the output port number
Nr
with the format 'OutP.%d'
.
- If a custom signal name is provided in
varargin
, use it instead of the default name.
- Generate a full signal name by combining the block's name (retrieved using
smbWhich(block)
) and the signal name.
- Retrieve the port handles of the block using
get_param
and the block's name.
- Set the name of the specified output port to the generated full signal name using
set_param
.
- Enable data logging for the specified output port using
set_param
with the 'DataLogging'
parameter set to 'on'
.
- Optionally, the function can display the name and data logging status of the output port if no output argument is specified.
Algorithm explaination created using ChatGPT on 2025-08-18 22:45. (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