m script bus selector output

5 次查看(过去 30 天)
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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2018-2-28
编辑:Fangjun Jiang 2018-2-28
'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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by