Detecting Bus Selector missing input signal
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear All, I have a bus selector,in which some of the input signals to the bus selector are selected as bus selector output signals already.But at a later point of time,I delete one signal from the bus creator which fed to the bus selector.
So at the bus selector output,the deleted signal will be shown as "???xxx" (consider xxx is the already selected signal).
If I read the output signals of the bus selector by get_param function,still I get signal xxx.
I want to know how to detect this missing input signal "???xxx" from command window.
Any help will be highly appreciated.
0 comentarios
Respuestas (1)
goerk
el 29 de Sept. de 2015
a fast hack is shown in this code snippet:
busselectors = find_system(gcs, 'FindAll', 'on', 'BlockType', 'BusSelector')
for i=1:length(busselectors)
%detection
outputSignals_str = get_param(busselectors(i),'OutputSignals');
outputSignals = strsplit(outputSignals_str,',');
inputSignals = get_param(busselectors(i),'InputSignals');
isValidSignal = false(size(outputSignals));
for j=1:length(outputSignals)
isValidSignal(j) = sum(strcmp(inputSignals,outputSignals(j)))>0;
end
%eg. remove the not valid signals
validOutputSignals = outputSignals(isValidSignal);
validOutputSignals_str = strjoin(validOutputSignals,',');
set_param(busselectors(i),'OutputSignals', validOutputSignals_str);
end
2 comentarios
goerk
el 30 de Sept. de 2015
Hi Rajesh,
for nested busses the idea is the same, but as inputSignals you get a cell array instead of a string. With a bit of work it should be possible to generate the strings out of it (eg. nestedBus.sig01). With this strings the rest can be performed with the code from above.
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!