Main Content

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 Connected IO Mode

  1. To switch to Connected IO mode if needed, on the Desktop Real-Time tab, select Mode > Connected IO.

  2. To start the real-time execution, click Run in Real-Time.

  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 Run in Kernel Mode

  1. To switch to Run in Kernel mode if needed, on the Desktop Real-Time tab, select Mode > Run in Kernel.

  2. To start the real-time execution, click Run in Real-Time. The model builds, connects to Simulink® in Run in Kernel mode, and starts.

  3. 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('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