smbLogOutputPort

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.1, Creation date: 2016-12-17, Last change: 2025-09-14

actives a Blocks's Output Port for Data logging



See Also: smbSimulate , smbAddFrameSensor , smbTofSimOut

Example Illustration

 missing image of smbLogOutputPort (block,Nr)

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

Algorithm Steps

  1. Check if the block parameter is empty. If it is, set block to the current block using gcb.
  2. Construct a default signal name using the output port number Nr with the format 'OutP.%d'.
  3. If a custom signal name is provided in varargin, use it instead of the default name.
  4. Generate a full signal name by combining the block's name (retrieved using smbWhich(block)) and the signal name.
  5. Retrieve the port handles of the block using get_param and the block's name.
  6. Set the name of the specified output port to the generated full signal name using set_param.
  7. Enable data logging for the specified output port using set_param with the 'DataLogging' parameter set to 'on'.
  8. 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