Is it possible to toggle visibility of signals in (floating) scope during simulation?

2 visualizaciones (últimos 30 días)
I am looking for a way to connect multiple signals to a Simulink scope (can be a floating scope as well) and dynamically toggle the visibility of lines (individual signals) during a simulation. The toggling could for example be handled in a callback function, a Matlab function block, or a StateFlow action. Is there a way to (programmatically) achieve this? Important is that it needs to work during a simulation.

Respuestas (2)

Anh Tran
Anh Tran el 8 de Sept. de 2017
Editada: Anh Tran el 8 de Sept. de 2017
I tried a simple test to check if setting scope configuration in runtime is possible or not: 1. Open shipped demo 'vdp'
>> vdp
2. Set the end time to Inf and run the model
3. In MATLAB command window, I can change the scope configuration during simulation. In this case, by changing 'Visibility' property, I can open or close the scope.
>> myScopeConfiguration = get_param('vdp/Scope','ScopeConfiguration')
>> myScopeConfiguration.Visible = true
If you are able to dynamically toggle the visibility of lines with callback function or MATLAB function block, you should be able to perform this workflow with command line functions. Good luck!
  1 comentario
Joost
Joost el 9 de Sept. de 2017
Thank you for the answer. I think my question was not clear enough. I do not want to toggle the scope visibility. The goal is to toggle which of the input signals is shown on the scope. I could not find in the documentation if this is possible. Any ideas?

Iniciar sesión para comentar.


Anh Tran
Anh Tran el 11 de Sept. de 2017
I was not able to find information on how to toggle which input signals are shown on the scope programmatically. I will create an enhancement request for the development team to consider this feature in future release.
  3 comentarios
Robyn Galliers
Robyn Galliers el 11 de Mayo de 2024
Hello, was this ever completed? I am looking to do exactly this
Joost
Joost el 13 de Mayo de 2024
hello Robyn, Thank you for reaching out.
I am not aware about any progress on this matter. As you can see my original post is from 6.5 years ago. Since then I did not use Simulink that much anymore, I more and more do in plain Matlab...

Iniciar sesión para comentar.

Categorías

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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by