m script bus selector output

5 views (last 30 days)
Joseph Stalin
Joseph Stalin on 28 Feb 2018
Edited: Fangjun Jiang on 28 Feb 2018
Hi, I am writing a m-script to create a bus selector , getting an input bus and select a particular bus as a output bus. by the following line..
helpdlg('Connect the main bus to CCF routing SS'); %this connects the main bus to the input of the bus selector set_param(CCF_Controller_base_path_2,'OutputSignals', 'GWM_FR_BCM_A_BUS');
but I am getting an error that the 'GWM_FR_BCM_A_BUS' bus is not in the input bus. I have confirmed that the Inut bus is connected before executing the set_param line.. but still I am getting the error..
Anybody can help me to understsand the issue or better coding technique?
regards, Joseph

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 28 Feb 2018
Edited: Fangjun Jiang on 28 Feb 2018
'GWM_FR_BCM_A_BUS' should be an immediate element of the input bus, not the input bus itself, right?
In any case, I would suggest you making the connection and selection manually first and then run get_param(CCF_Controller_base_path_2,'OutputSignals') to see what is the output.
Sometimes in a large model, the content of the bus is not immediately available after the BusSelector block is connected with the input bus. Maybe that is the cause in your case. You need to do a model update to make the content available. You can do this by
set_param(YourModelname,'SimulationCommand','update')

More Answers (0)

Categories

Find more on Interactive 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!