The program is a windows based command-line executable. The executive is a polled loop using the system time in milliseconds. The executive runs whenever that system time changes, otherwise it idles. The executive is a simple list of tasks, to scan inputs, process (algorithms), set outputs, perform (system) overhead tasks, and run a UDP server. The udp server handles system and process data. A separate user interface displays data and sends control commands to the executable. The physical plant is simply a first order low-pass filter. The data for the 'GUI' downsamples from the timebase rate to about 50 ms, that is if the timebase is at 10 ms it downsamples once every five points, at 15/16 ms it downsamples once every 3 points.
The code provided is only meant for instructional purposes and is without warranty and without error handling. Use this code only with the understanding it is for demonstration purposes only. I wrote this because I've often had to develop code with limited or no resources. Having an executive that is at least sampled if not exactly 'real time' provides a means of writing and debugging code for embedded control without a platform. Since this is a Cygwin based compiled program, it can be debugged using GDB.
The program can be compiled using Cygwin. The gui is implemented in Perl with support for Perl/Tk and requires two perl packages, Canvas.pm, and Canvasplot.pm that can be obtained from the following site.
Build
Start Program
GUI
Tuning
Exit Program
And for this page: