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
See Also: smbCreateConnection
, smbCreateSG
, smbCreateSGJoint
, smbCreateSGNode
, smbCreateStopJointC
, smbCreateStopJointR
, smbCopyConnections
, smbCreateDrive
, smbCreateSineWave
smbCreateBlockConst([SName,EPort,amp])
SName: | Generator name; default is 'Const' | |
EPort: | Optional Port to connect | |
amp: | optional value; default is 1 |
VLFL_EXP26
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:
smbAddBlock to add a 'Constant' block to the current Simulink model (gcs) with the specified SName.smbSetPosition and smbNewGridPos with a grid position of -1.amp using set_param.EPort is not empty, it performs the following:EPort before the last '/' character.smbWhich to resolve the subname.smbGetPorts to retrieve port information for the subname.delete_line.EPort using add_line with 'autorouting' enabled.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)