## 4 The Architecture of a Real-Time Control System and Incorporated RT-Sequencer
### Target Environment and Problem Domain Architecture  
RT-Sequencer is a part of a broader RTC system, which architecture is shown in Figure 3. The _host computer_ is designed to model an RTC system and to configure, capture, process, and visualize captured real-time data.  
On the _host computer_ (right-hand side in Figure 3) is installed MS Windows, where the Dewesoft X software is running. The software package consists of a _Data acquisition_ module for capturing various types of data (e.g., AI, DI, CNT, CAN, XCP) and a _visualization_ module with various visual widgets such as graphs, tables, digital meters, analog displays, etc. The software package also includes a module for _configuring_ and setting multiple input and output sources. A _math analysis_ module (digital filters, counters, advanced math modules, etc.) is used to process the data. There are also modules for post-processing data (_offline analysis_) and exporting them to various data formats (e.g., Matlab, MS Excel, CSV), as shown in Figure 3.  
In addition to the mentioned components, the system also includes the _RT-Sequencer_ (right-hand side of Figure 3), which is the heart of the new tool. It consists of a _modeling  
Figure 3: Domain architecture of the Sequencer.  
tool_ with the possibility of tool configuration, visual block creation for advanced end-users, program modeling for domain experts, and processing & visualization. The second set presents a _modeling language_ with DSML visual notation and C++ support, which is needed to define the modeling tool, visual notation of models, and GPL inclusion in models. The last set is the _translation_ from the DSML language to the abstract syntax tree (AST), further to the C++ GPL programming language, and, finally, using the GPL compiler to generate the assembly code (ASM). All three sets will be presented in more detail in Section 6.  
The _real-time controller_ (left-hand side of Figure 3) consists of specific _hardware_, sensors, and, on the other hand, the Dewesoft RT firmware. The firmware is selected and adjusted according to the requirements of the measuring system. The types of input signals are determined, as well as the sensors, digital inputs, and data buses used in capture and control. In addition to our view, it is also necessary to consider real-time specifications such as response time. Dewesoft RT runs on an RT operating system, and consists of various components. The _core components_ of the program are the basic structure and associated parts (data, channels, buffer, etc.). Multiple modules are connected around it. The connection module takes care of _communication_ with the outside world via the OPC-UA protocol [34]. It can be used to connect to the system from a host computer or various SCADA systems. The _system monitor_ module takes care of system diagnostics, as it is crucial in RTC systems. It is also possible to store data directly for later analysis on the system (_Store/load engine_). Capturing input data and transferring them to the system is handled by a _DAQ Module_. Calculation of the various DSP operations (filtering, statistics, etc.) takes care of the _processing_ module. The _RT program_, which is modeled with the help of a host computer and translated into the C++ programming language and then to the execution code, is executed within the RT-Sequencer, more precisely, within the _execution framework_.