
What does the error "the number of signals at the input to the block must match the number of object elements" mean?
    48 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    MathWorks Support Team
    
 el 19 de Feb. de 2019
  
    
    
    
    
    Editada: MathWorks Support Team
    
 el 23 de En. de 2023
            I am creating a Simulink model in release R2017a where I am using a "Bus Creator" block.
When I try to run the model, I get the following message"
The bus data type TYPE specified in BLOCK is not valid; the number of signals at the input to the block 
must match the number of object elements.
I have three elements at the input to the "Bus Creator" and have specified the output as a bus object with three elements of the same data type. 
What does this error message mean?
Respuesta aceptada
  MathWorks Support Team
    
 el 10 de En. de 2023
        
      Editada: MathWorks Support Team
    
 el 23 de En. de 2023
  
      This error often appears when you are using a specific type of bus in the "Bus Creator" block. You can check this setting in "Output Data Type" of its properties dialog. For example, in the image below, the "Bus Creator" uses a custom bus named "MyBus":

The most common occurrence of this error is when the number of inputs to the "Bus Creator" block do not equal the number of elements in the specified bus type. 
Additionally, it can also appear when there is a mismatch between the input signal names and the bus elements' signal names. This is the case asked in the question. This is related to the setting "Override bus signal names from inputs", and unchecking it should resolve the issue. 
The "Override bus signal names from inputs" setting causes the names of the incoming signals to determine the names of the elements of the bus. Even if the incoming signals do not have names, the default names of "signal1", "signal2", etc. are used. This creates a problem if you try to set the output data type to be a specific type of bus with specific element names. The names end up not matching and you receive the error message regarding the number of signals not matching.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Signals en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!