How can I modify the input signal names of a Bus Creator block from the command line in Simulink?
11 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Edited: MathWorks Support Team
on 10 Oct 2024
I am trying to modify the input signal names of the Bus Creator block from the command line and am unable to determine the block property which needs to be changed to accomplish this. Also, I am unable to programmatically change the "Require input signal names to match the signals below" drop down list.
Is this supported from the command line in Simulink?
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
To modify the names of a Bus Creator block's input signals from the command line, set the block's 'Inputs' parameter to the desired signal names, using SET_PARAM.
Note that you can set this parameter either to the number of input signals, which will automatically turn on the 'Inherit bus signal names from input ports' option, or to the names of input signals, which turns on the 'Require input signal names to match signals below' option.
For more information on the 'Input' parameter of the Bus Creator block see the documentation section titled: 'Block-Specific Parameters'
To open this document automatically execute the follwoing in a R2008a MATLAB command window
web([docroot '/toolbox/simulink/slref/f23-20073.html'])
For example, observe the outputs and the differences between the following two function calls:
% This call changes the number of inputs to 2
% and sets the block to "Inherit bus signal names from input ports"
set_param(gcb,'Inputs','2')
% This call changes the number of inputs to 2,
% the signal names are specified as shown, and the block is set to "Require
% input signal names to match the signals below"
set_param(gcb,'Inputs','''my_first_signal'',''my_second_signal''')
1 Comment
Qu Cao
on 9 Jan 2017
Edited: MathWorks Support Team
on 10 Oct 2024
'OutputSignals' should be the parameter: https://www.mathworks.com/help/simulink/slref/block-parameters-and-properties.html
More Answers (0)
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!