Real time interface using App Designer for Simevents?

2 views (last 30 days)
Is there a way to make a real time interface using App Designer for Simevents?
I have an entity attribute called color, and when the entity reaches the last server, I want to show the user that the corresponding button of color is pressed. Is there a way to do this?

Answers (1)

Hari
Hari on 5 Sep 2023
Hi Ho Jung Kim,
I understand that you have a SimEvents model where entities move through servers, each with a "color" attribute. You want to create a real-time interface using App Designer to show the user that the corresponding color button is pressed when an entity reaches the last server.
It is possible to do so using App Designer. I assume, you have created an App Designer GUI with all the visual elements required in your app. You can follow the below steps:
  1. Integrate “SimEvents” with the App Designer GUI: In the “SimEvents” model, utilize the “eventSend” block or a custom block to send events when an entity reaches the last server. Write a MATLAB callback function that receives these events and updates the GUI accordingly. This callback function can be defined within the App Designer code or in a separate MATLAB function file.
  2. Update the GUI in real time: In the callback function, update the status of the buttons based on the received events. Use appropriate MATLAB functions, such as set or “app.Button.Value”, to change the state or appearance of the buttons. You can also update the label or indicator to display the status information.
  3. Start the “SimEvents” simulation, which will generate events based on the model logic and run the App Designer GUI, which will display the buttons and update them in real time based on the events received.
By following these steps, you can create a real-time interface using App Designer to visualize the status of entities in a SimEvents model.
Refer to the below documentationsCallbacks in App Designer” andEvents and Listeners” for more information.

Categories

Find more on Discrete-Event Simulation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!