Problem Statement:

Figure 3 shows the tank system now with a control valve at the input.

  1. Design an on-off controller that maintains the water level to a configurable set point by turning on until it reaches the high threshold.
  2. Design the controller to have thresholds of +/-10% of the set point.
  3. Create minor alarms for when the water level exceeds +/- 30% of the set point.
  4. Create major alarms for when the water level is within 5% full capacity and empty.


Create an asynPortDriver to accomplish this. Additionally, your port driver must either retrieve data from a circular buffer or put data into a circular buffer for the water level of the system.

Any record you would like to use a scan field on must use "I/O Intr" as the scan rate.




Figure 3. Phase 3 Tank Diagram with Control Valve

You should be able to use the same pydm display created while completing Problem 5.

Helpful Links:

GDB Cheat Sheet 

GDB Cheat Sheet 2

Creating an AsynPortDriver

There isn't really a good way to launch gdb from the shell during startup as a lot of it is obfuscated through the makefiles; when using GDB I retrieved the process ID through either through sys call within the code itself (reference here) or through using the command line;


ps aux | grep <Your UserName>

Look for the associated pid then;

gdb -p <pid>

To capture the process and use GDB.


To call gdb on an executable:

gdb ./<exe_name>


To call gdb on an executable with TUI and arguments:

gdb --tui --args ./<exe_name> <arg1> <arg2>
  • No labels