In Merge block, For execution of more than one subsystem(Nested If loops) I have an error saying Ensure that the Merge block output is updated by only one of its input signals

22 visualizaciones (últimos 30 días)
For this project all I am using nested if loops, I need the value at the end to display the most recently computed output of its driving block.
I am facing a small issue with merge block.
I have 4 nested if loops and I am trying to merge the answers, but I am having the trouble with understanding the error
Caused by: Output of Merge block 'bug/Merge1' is being updated concurrently at t = 0 by both block 'bug/Step1//1' 'Output Port 1' and block 'bug/If Action Subsystem' output port 1. Ensure that the Merge block output is updated by only one of its input signals at every time step
So I can neither use concatenate block nor bus creator block.I have attached the Simulink file just in case if it could help you understand my problem better.
Kindly please help me to resolve this issue or if you have any better solution for such kind of problem. Thankyou!
  5 comentarios
Rasya KIRANI AMARNATH
Rasya KIRANI AMARNATH el 25 de Ag. de 2022
Editada: Rasya KIRANI AMARNATH el 25 de Ag. de 2022
Yes Its the continuous nested if loop, I cant change the sample time or add delay. So I am looking for way to resolve this situation @Walter Roberson

Iniciar sesión para comentar.

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 26 de Ag. de 2022
Editada: Fangjun Jiang el 29 de Ag. de 2022
You need to re-construct your model.
At any time, there should be at most one of the inputs at the Merge block being updated. At time 0, you have two inputs at the Merge block being updated. That is the error.
You thought that since you had the nested if-else condition, it is guaranteed that only one of the inputs getting updated. It is true in logic and it is true if it is implemented in coding. But it is not true based on the way it is implemented in your Simulink model.
For example, the If block "Step2" is always executed (surprise!). One of its two outputs will always drive downstream blocks to be executed.
It could be implemented using Simulink blocks, but if you use if-else conditions, you need to wrap all the "else" contents in ONE action subsystem, not like the way you implemented it, where it is flat, it is not "nested". Block "Step3" is also always executed.
For this logic, I recommend using a MATLAB Function block, where you write MATLAB code to implement the logic.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by