How to eliminate delays in drawing a graph during modeling in Simulink, in a dashboard?
Show older comments
I work in Simulink.
I am making a model with cyclic calculations. The model is complex, I’m struggling with speed, trying to optimize the calculations.
To visualize the results of the cycles during the calculations, I would like to use a graph. I took it from the dashboard...
But the results are not displayed on the graph in simulated time. There are long delays in displaying monitored parameters on the graph.
Sometimes the display is formed only after all modeling cycles have been completed.
Is it possible to eliminate the delay in drawing graphs in Simulink, in a dashboard?
Answers (2)
Sara Nadeau
on 7 Oct 2023
1 vote
Have you looked into any of the limitations listed in the documentation for the Dashboard Scope block?
Notable limitations include:
- If the Dashboard Scope block is inside a referenced model, the plot does not update during simulation.
- No support for rapid accelerator simulations.
- Signals that are reduced through optimizations such as block reduction or accelerator mode aren't displayed in the plot. To view such a signal, mark the signal for logging.
Does the plot update after the simulation ends?
9 Comments
Sara Nadeau
on 9 Oct 2023
Why can't you enable signal logging?
You could also try using the Scope block, potentially, but this has a similar effect to marking the signal for logging. Both actions add a block to the path that executes with the same sample time as the signal, so that the block that was previously optimized out is no longer optimizeed out.
Alex K
on 9 Oct 2023
Sara Nadeau
on 9 Oct 2023
Such an option does not exist in the block parameters. The behavior is based on the signals you view on the Dashboard Scope block. Based on your first response, it sounds like you have the Dashboard Scope block connected to a signal that might not be supported for streaming during simulation.
The screenshot also looks like the Dashboard Scope might actually be streaming the data, though. The plot in the Dashboard Scope block does not update every time a new value is calculated. Based on several characteristics of the simulation and the model, the software determines when to update the plot with a new batch of calculated values.
Is it possible that the Dashboard Scope is updating during simulation, it just takes a bit to calculate the values needed to update the plot?
Alex K
on 9 Oct 2023
Image Analyst
on 9 Oct 2023
Why are you not simply calling tech support on the phone??? Why let this go on for weeks???
Alex K
on 9 Oct 2023
Sara Nadeau
on 9 Oct 2023
Ah, I see. I'm not sure beyond those limitations what might explain these behaviors that you describe.
Unfortunately, I'm also not aware of any setting that would allow you to force updates every calculattion cycle.
Alex K
on 9 Oct 2023
Image Analyst
on 1 Oct 2023
I don't know Simulink, but it MATLAB you'd call
drawnow;
to force an immediate update/refresh of the screen and plots.
Categories
Find more on Control Simulations with Interactive Dashboards in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!