I converted a referenced subsystem into a referenced model in my Simulink model to get a faster build time.
The build time got faster, since the referenced model is just rebuilt, if it has changes.
Now I found, that the external mode is not available in a referenced model.
Even, if the model has just one instance.
Is there another way to observe signals in this referenced model?
I tried the Simulink data inspector and the external mode signal list.
Both did not show any signals from the referenced model.
And I can’t use the web interface, since I’m using b&r extended struct blocks.
Hi @Lukas_Angst , I think we do not have many experts there about simulink topics. I checked history and maybe @marcusbnr can help.
I asked our internal knowledge tool powered by AI. Usually, I don’t copy and paste answers from this tool here without proofreading them, but since I don’t have enough knowledge about this topic, I can’t tell whether the answer/suggestion is completely wrong.
Please check it. Maybe you’ll find some hints in the answer that can help you. If it is completely wrong, please provide me with feedback as well, and I will delete it so that it doesn’t confuse people there.
AI GENERTED:
Analysis
When you switch from referenced subsystem to referenced model, internal signals of that referenced model are typically no longer exposed via the same external-mode path in ASTarget/Simulink integration.
So SDI/external-mode signal lists showing no internal signals is consistent with this limitation.
Proposed Solution
Use one of these workarounds:
Promote needed internal signals to model outputs (Outport in referenced model, then connect in top model).
Most robust approach.
Signals become visible at top-model level (where external mode can access them).
Log signals inside the referenced model to workspace/file (for offline analysis).
Not live monitoring, but good for debugging/tracing.
Temporary debug path: during analysis, convert only the problematic part back to subsystem (or keep a debug variant) to regain live internal signal visibility.
Given you cannot use Web Interface due to B&R extended struct blocks, option 1 is usually the best for online observation.
That looks similar to what I found out. Matlab would support a real time logging of the signals,
if the external mode connection is done via xcp.
But I think the B&R connection is not on the xcp protocol.
I think I go with the first suggestion and add a LocalDiag Bus Out element to each subsystem to have a slim signal handling.
And outside my referenced model, I should be able to log this LocalDiag Bus.
I will inform you, if I have realized this workaround.
Hi @kovarj
The solution with the LocalDiag Bus is not working.
The signals promoted to the top model need a display or a scope directly connected to the signal.
I can not connect the whole bus.
So I would have to use a bus selector and connect each signal separately.
I have around 150 Signals, so this would not be easy to keep an overview.
I tried to use the Simulink Data Inspector, but this tool can only show signals, that are already connected to a scope in the top model.
Currently, I know no possibility to use the external mode in a referenced model.
I was thinking about a separate code generation for the referenced model.
Would this help?
Best Regards
Lukas