Docs
/
Components
/

Components

Components

Components let you deploy custom logic that runs in real-time inside the Koios platform. Use them to build control algorithms, data transformations, state machines, alarm logic, and custom protocol adapters — all without managing external infrastructure.

Key Concepts

The component system has four main building blocks:

ConceptWhat It Is
LibraryA packaged collection of component types, uploaded as a .kcl (Koios Component Library) file
EnvironmentAn execution context where component instances run at a shared scan rate
InstanceA running copy of a component type, placed on an environment's canvas
WireA data connection between an instance's input/output and a tag, another instance, or historical data

How They Fit Together

Library (.kcl)              Environment
  ├── Adder                   ├── Instance: "Room Temp Avg" (Adder)
  ├── Latch                   ├── Instance: "Alarm Latch" (Latch)
  └── MovingAverage           └── Instance: "Smoothed Pressure" (MovingAverage)
                                     ↕ wires ↕
                              Tags, other instances, historical data
  1. Upload a library containing one or more component types
  2. Create an environment with a scan rate (how often components execute)
  3. Add instances of components to the environment's visual canvas
  4. Wire inputs and outputs to tags, other components, or historical data
  5. Enable the environment — the component engine begins executing your logic

Component Types

Libraries can contain four categories of components:

CategoryUse CaseExamples
ControlFeedback loops and setpoint managementPID controllers, fuzzy logic, cascade control
ProcessingData transformation and aggregationScaling, moving averages, unit conversion, filtering
LogicDecision making and state managementState machines, latches, edge detection, alarm rules
ProtocolCustom device communicationProprietary protocols, data adapters

Koios ships with a Core Library containing common building blocks — math operations, boolean logic, comparisons, signal processing, and more. You can also build and upload your own libraries.

Execution Model

Each environment runs its components in a continuous loop at the configured scan rate:

  1. Read inputs — resolve all wired input values from tags and other components
  2. Sort by dependencies — components are automatically ordered so that upstream outputs are available before downstream inputs need them
  3. Execute — each component's logic runs in dependency order
  4. Write outputs — results are pushed to wired tags and made available to other components

Components maintain their internal state between cycles. A moving average remembers its buffer, a latch remembers its position, an integrator accumulates over time. State resets when the instance is reconfigured or the engine restarts (offline values provide reset defaults).

What's Next