Is it possible to have a generic bus selector?

조회 수: 3 (최근 30일)
Jagmohan singh
Jagmohan singh 2012년 6월 18일
while selecting the signal from bus selector, we need to go bus selector parameter and need to select the required signal manually. I want a bus selector to be a part of a masked subsystem. The signal to be selected by the bus selector will be given through masked parameter. For e.g. I have two signals 'a' and 'b' as input to bus selector. I will mask this subsystem and will give a mask parameter 'Which signal to select'. User can give either 'a' or 'b' and accordingly bus selector should select the signal. Is it possible? I am using matlab2006b.
Thanks in advance.

채택된 답변

TAB
TAB 2012년 6월 18일
Check Signal Routing\Slector block. It also does the same thing.
Set Index Option as Index vector (dialog) and enter the bus element index value which is to be selected.
[Edited 19 June 2012]
get_param('BusSelectorBlock','InputSignals')
returns the name of the signals present in the bus which is input to the bus selector block and...
set_param('BusSelectorBlock','OutputSignals','SignalName')
sets the signal to be selected as output of bus selector.
Using these two commands in the callbacks of your masked subsystem, you can implement your requirement.
  댓글 수: 2
Jagmohan singh
Jagmohan singh 2012년 6월 18일
Sorry if I wasn't clear,
Signal Routing\Selector expects index numbers, but i want to select the signal by its name as bus selector does. In my knowing index of the data to be selected is very difficult. But for sure all the times name of signal will be known. As I mentioned in my que, in input bus signal i can have many signals, but i want bus selector to direct a particular signal and that signal name should be assigned through mask parameter.
Thanks in advance..
TAB
TAB 2012년 6월 19일
Please see edited part of the answer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by