smbCreateBlockConst

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.3, Creation date: 2017-01-09, Last change: 2025-09-14

Creates a block with a constant value



See Also: smbCreateConnection , smbCreateSG , smbCreateSGJoint , smbCreateSGNode , smbCreateStopJointC , smbCreateStopJointR , smbCopyConnections , smbCreateDrive , smbCreateSineWave

Example Illustration

 missing image of smbCreateBlockConst (SName,EPort,amp)

Syntax

smbCreateBlockConst([SName,EPort,amp])

Input Parameter

SName: Generator name; default is 'Const'
EPort: Optional Port to connect
amp: optional value; default is 1

Examples


VLFL_EXP26




Copyright 2017-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, smbCreateBlockConst, is designed to create a Simulink block with a constant value. It is part of the SG-Library and was introduced in SolidGeometry 3.3. The function takes up to three input parameters:

The function begins by checking the number of input arguments (nargin) and assigns default values if necessary. It then proceeds with the following steps:

  1. Calls smbAddBlock to add a 'Constant' block to the current Simulink model (gcs) with the specified SName.
  2. Sets the position of the newly added block using smbSetPosition and smbNewGridPos with a grid position of -1.
  3. Sets the 'Value' parameter of the block to the specified amp using set_param.
  4. If EPort is not empty, it performs the following:

This function is useful for creating and connecting constant blocks in a Simulink model, with optional customization of the block name, connection port, and amplitude value.

Algorithm explaination created using ChatGPT on 2025-08-19 08:26. (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