How can I display the results from simulink to the GUI ?

3 visualizzazioni (ultimi 30 giorni)
Hi, I'm currently trying to design an interface using the GUI and I'm trying to put the output from simulink into the edit box in the GUI.
In simulink I have a battery charger circuit and I use Display to output the percentage of battery capacity (SOC), and I added a To workspace block. So now how should I code so that the result is displayed in the edit box in the GUI, hope everyone can help me.

Risposte (1)

Githin George
Githin George il 13 Dic 2023
Hello Xuan,
It is my understanding that you would like to update a GUI with the output from a Simulink Model during model execution.
You can use various Simulink callbacks and events to sync the GUI with your model. For instance, you can register a listener function using “add_exec_event_listener” function for the ‘PostOutputs’ event of display block. This event is triggered at every time step of model execution. You can add the logic to update your GUI in the listener function.
For a more detailed explanation, you can refer to the following link.
I hope this helps.

Categorie

Scopri di più su App Building in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by