You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Plato Engine Block is the reference implementation of the Plato monitoring philosophy: read sensors, store history, fire alarms, stream it all. It's designed to run anywhere — from POSIX servers to bare-metal MCUs to game loops — with zero dynamic allocation after initialization.
The engine implements a tick-driven loop: each tick reads all registered sensors, stores values in a ring-buffer history, evaluates alarm thresholds, and optionally broadcasts results to TCP subscribers. The entire implementation fits in a single C99 header file (~400 lines) with a companion daemon and TCP server. No heap allocation. No threads. No external dependencies. Override the configuration constants before #include to tune for your target — from 800 bytes of RAM on an ESP8266 to the full 8 KB default configuration on a server.
This is the C flagship implementation in the SuperInstance PLATO ecosystem. Each engine block is one cell in the tensor grid managed by plato-runtime-kernel. The engine handles the physical layer (sensors, actuators, ticks); the runtime kernel handles the spatial layer (topology, traversals, contracts).
Performance Characteristics
Metric
Value
Single tick (16 sensors)
< 1 μs
History lookup
O(1)
Alarm evaluation (16 alarms)
< 1 μs
Memory (default config)
~8 KB
Memory (embedded config)
~1.5 KB
Binary size (stripped)
~15 KB
Dynamic allocations
0 (after init)
Thread safety
None (single-threaded by design)
API / Usage
Header Library (plato_engine.h)
Include in one .c file with #define PLATO_ENGINE_IMPL for the implementation.
make test# Builds and runs all tests# Run daemon interactively
./plato_engine
# TCP server (auto-ticks every 2000ms)
./plato_server
# Auto-tick daemon at custom rate
./plato_engine -a 100 # 10 Hz