The industrial automation software can be essentially grouped in two big categories: monitoring or controlling software.
Monitoring (and configuring) applications are basically a program that can configure, start, stop and (more generally) influence in some way the machinery program but do not handle it directly.
Controlling applications instead embed the machinery program in some part of their code. They are directly responsible of the quality of the real-time achievable by the system.
In a typical automation software, the machinery program is executed repeatedly inside an infinite loop. Each iteration, called scan, is composed by three well-defined steps:
- inputs reading: the inputs image (the set of the input states kept in memory) is updated with the machinery input states;
- machinery program: the output image is modified depending on the state of the input image (and eventually by some internal memory state);
- outputs writing: the machinery output states are updated with the outputs image (the set of the output states kept in memory).
To be real-time, each scan should be run in a predefined time interval, here called scantime. If a scan takes more than two scantimes (too slow) or two scans take less than one scantime (too quick) the real-time contract is violated and the program must be stopped in emergency mode.
In a hard real-time system, this contract is checked by an external hardware device, e.g. with a watchdog timer. In a soft real-time system this is emulated via software, e.g. by checking the scantime at each iteration.
At eNTiDi we tend to use industrial PC with soft real-time environments. The scantime is typically in the millisecond order. The PREEMPT-RT patch makes once again the GNU/Linux operating system a perfect choice for this kind of projects.