To create a p-h diagram in App Designer:
UIAxes Callback: Write a callback function (e.g., "updateAxes") to:
- Access latest pressure/enthalpy using "get_param('SimulinkModelName','SimulationState')".
- Update "XData" and "YData" of the Axes component with retrieved values.
Triggering the Callback: Use a timer object in your App code or a Simulink "Update Diagram" block to call the callback function regularly during simulation.
This approach allows for a real-time p-h diagram reflecting your Simulink refrigeration model's behavior.