필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Writing value to Workspace and taking that value from workspace to be used in another model part

조회 수: 1 (최근 30일)
Hello,
I have an urgent problem to be solved and would be very grateful for your help.
I have created a variant subsystem, with two variants that can be switched between (Mode=1, Mode=2). Now I want to simulate my model, and during simulation the right variant should be selected according to a condition. So I use a "To Workspace" block to store the result of the condition as a parameter "Mode" to Workspace, being either 1 or 2.
My Problem is, that during simulation the variant part uses the old value of "Mode", without waiting for the condition to perform the new one. I have already tried to use atomic subsystems, or regulate the execution priorities in the Block Properties menue, but nothing works. How can I inhibit a certain part of a model from performing too early?

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2013년 4월 5일
I don't think Variant Subsystems are meant to switching between variants at run-time. As the documentation states:
Variant subsystems provide multiple implementations for a subsystem where only one implementation is active during simulation.
Since your use-case involves switching between implementations at run-time, Enabled Subsystems might be appropriate for you. See this example for how you can implement this.

Kushagra
Kushagra 2013년 4월 5일
You can either use enabled subsystems as suggested by Kaustubha or you can put both the subsystems in the model and take the final output from the multiport switch.
  댓글 수: 1
Kubilay Cokgueler
Kubilay Cokgueler 2013년 4월 5일
Thanks for the answers. I have already tried the enabled subsystem method. The Problem is, I have to switch between several lookup tables. As the axis array assigned to a lookup table must be monotonically increasing, an error is given out if thats not the case, even if the particular enabled subsystem, with the "bad" lookup table is not enabled by the condition. But thats exactly what my conditions should be avoiding. So enabled subsystem doesnt deactivate a block completely, thats why I was trying with the variant subsystem.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by