Skip to content

Building Applications

A real-time database (RTDB) is used to coordinate all interactions with I/O systems and all communications between the various finite state machines. This database is also used for communication between the StateWORKS software and other processes running in the system. Although we use the term “database”, this has nothing to do with formal relational databases such as SQL; it is a collection of objects required by the project, together with software that manages them. For more information, refer to StateWORKS Runtime System (Executor).

The following diagram illustrates which components are needed for writing an RTDB-based application. The heart of the system is the RTDB library, which also contains the VFSM executor. The I/O Handler is an application-specific library that manages the data flow between the controlled devices and the application. The Ofun library is a set of application-specific functions required by the control system. Both the I/O Handler and Ofun communicate with the RTDB, which provides the corresponding methods used to program these modules. The application is completed by a VFSM specification file prepared by StateWORKS Studio. Alternatively, the specification results can be loaded from disk, which is especially recommended during the development phase.

RTDB Build Environment

RTDB Build Environment

Communication with the real world happens through the I/O Handler. The I/O Handler delivers all inputs to the RTDB. On the other side, the RTDB generates outputs, which are converted by the I/O Handler into real signals understood by the controlled devices.

The user interface, as well as monitoring and maintenance, is handled by clients connected to the TCP/IP maintenance interface.

The thinStates compiler translates the StateWORKS specification results into C code. This is primarily intended for embedded systems that cannot support the full RTDB library, but it can also be used on any platform if required.