Simulink debugger and referenced models

조회 수: 5 (최근 30일)
Jesse
Jesse 2011년 8월 10일
답변: Omkar Karve 2020년 8월 5일
According to the Simulink Tool Limitations for R2011a breakpoints cannot be set inside a referenced model. I tend to use the debugger quite extensively to follow the signal flow throughout a model, not just at the boundaries of a system, when I'm debugging it so this seems like a very severe limitation to me. I've tried to think of a work-around to this limitation like creating the model references from libraries. Then embedding the model reference inside another configurable library so that during development I can configure with the library and get access to the signals in the library. Then when needed switch the configuration to the version with the model reference. While I think this would work, this seems like a crude hack that I can't quite justify and I'm sure I couldn't convince other project team members that it's justified.
So I have two questions:
1. Does anyone know of a better work-around to get the benefits of both model referencing when needed and still be able to create a single source for a model that can be debugged with the Simulink debugger.
2. If Mathworks pushes for model referencing as the solution to large model issues, will the Simulink debugger then eventually be considered only useable for small standalone models?

채택된 답변

MarkB
MarkB 2011년 8월 16일
I would recommend using a feature such as signal logging to monitor the values inside the model reference. It doesn't let you inspect things during the middle of a simulation, but you can examine them afterwards and it is a lot less work than the library approach above.
  댓글 수: 1
Jesse
Jesse 2011년 8월 17일
Thanks Mark. Unfortunately this was the answer I expected to get but not the one I'd hoped to get but thanks for the response anyway.

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

추가 답변 (3개)

Michel
Michel 2012년 8월 8일
Hi Jesse,
Have you been able to make progress on that debugging issue ?
If not, I guess I'll go for Mark's solution which I would prefer to avoid...
Cheers, Michel
  댓글 수: 2
Jesse
Jesse 2012년 8월 8일
That was my feeling as well (wishing to avoid signal logging). But to answer your question, no. I never did find a way to use the Simulink Debugger to inspect referenced models.
Michel
Michel 2012년 8월 8일
Thanks for your answer. I'll go for signal logging then.

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


Edzko Smid
Edzko Smid 2019년 4월 22일
I end up making a copy of the master model, and replacing the reference model with a regular subsystem, then cutting-and-pasing the contents of the reference model in the submodel. If there were a lot of changes, then copy-and paste the contents back to the reference model.

Omkar Karve
Omkar Karve 2020년 8월 5일
I came to this looking for a way to insert a breakpoint inside referenced models which have a simulink matlab function. If there is a function inside a referenced model, then the breakpoints inserted on lines inside that function do not work when you are simulating the main model.
Solution: remove the semicolon at the end of the line and the output is seen in the Diagnostic viewer.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by