Water Tank Model with Dashboard

This example shows a real-time model of a water tank controlled by dashboard controls. You can change the inputs to the plant by using the dashboard knobs and observe the response on the gauges.

Run Model in Normal Mode

  1. To switch to normal mode if needed, on the Simulation tab, select Normal mode.

  2. To start the real-time execution, on the Simulation tab, click Run.

  3. Change the input flow and output valve values by using the dashboard controls and observe the results on the dashboard gauges.

Run Model in External Mode

  1. To start the real-time execution in external mode, on the Desktop Real-Time tab, click Start. The model builds, connects to Simulink in external mode, and starts.

  2. Change the input flow and output valve values by using the dashboard controls and observe the results on the dashboard gauges.

Open the Model

open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_dashboard'));

Open Subsystem and See Signals Marked for Signal Logging

  1. Double click the Tank dynamics subsystem.

  2. Observe the Overflow, Water level, and Output flow signals are marked for signal logging with the Simulation Data Inspector.

Run the Model and View Logged Signals

  1. Click the Run in Real Time button.

  2. Click the Data Inspector button.

  3. Observe signal logging in the Simulation Data Inspector.

Clean Up the Model

clear
close all
bdclose all

See Also