Creating new application is based on modular approach borrowed from agent system. Each function block is encapsulated into module, which can communicate to other modules through Mikrix protocol.
Module encapsulates functionality. To accomplish communication with other modules, every module has possibility to communicate through data sinks and data sources.
First communication option is based on data flow approach. Data format is in raw byte format, so for manipulating with data, type definition is written in C structure. Other modules can include this definition and work with it. It is possible to connect multiple input sources into module. Current maximum sources for module is set to 8 and one for data output sink. For emulating multiple sinks, simple offset information is possible. It means, each module source can offset information from other module sink. Offset information is set while connecting module to other module. It can be dynamically changed when reconnecting different module.
Second communication option is based on messages. Every message contain header information and optional data payload. There are some specific predefined types of messages and message groups. For example button group, which contains predefined button clicked, pressed and released message. User can create 64535 own messages .
User can decide which way of communication is better for the application. Data source and data sink can vary in selected method. User must be aware of combining them in wise way. Mixing multiple methods in data sink is not recommended.
Sometimes there is need to create some special operation on module such as put module to special state or to set some features. For this purpose, remote calls or commands are presented. Commands differ from standard sinks and sources with the immediate action when called and different return value as module sink. Remote calls should be small and quick functions.
Module address is necessary for communication between modules inside the application or between multiple applications. Address is reserved for the module when creating new module. Every application contains own unique (UID) identifier (8 bytes) and dynamic address. Fist two address bytes identifies application. Third byte identifies application module. Module contains unique address (for example from fig, Button 1 module address is 10.0.1), where first two bytes of module address contains application address (10.0). Last byte of address contains module instance identifier (Button 1 module instance is 1).
Internal / external Connection
Remote calls
Interfaces allows application to communicate between others. Interface can be as simple as RS232 or to be really full featured as TCP-IP. It is possible to have multiple interfaces. Current implementation copy all external data communication to all interfaces. For broadcasting data, UDP or multicast communication is possible.
Each application has possibility to synchronize time between other applications (or devices). This feature allows to write module which fires data acquisition synchronously with other connected devices. Default time resolution is selected to microsecond. For example, such fine clock syncing allows sound source localisation on distributed microphones connected together. Precision of system clock sources can vary between devices. Frequency of crystals oscillator used in embedded systems are temperature dependent. For that reason, linear correction prediction system is available. It allows to maintain time synchronization within +- one microsecond for short time (period can be selected. Generally maximum period one minute can be achieved). Time synchronization repeat period must be set depended on this period.
Mikrix core is written in manner to be multi-platform. Core system is really small, it can run on small micro-controller equipped with 64kB ROM. Depending on enabled features, it can be shrink to smaller size. Therefore interconnection between computer and micro-controller can be easy. Linear microseconds time abstraction allows to create synchronous application between all platforms.