---
title: "Device Introduction"
description: "Overview of device connections in Koios"
source_url: https://ai-ops.com/docs/devices/introduction
---

# Devices

A **device** in Koios represents a connection to an external data source — a PLC, an OPC-UA server, a sensor gateway, a database, or an API. Devices handle the communication layer: each device maintains a persistent connection to its data source and scans its tags on a configurable cycle.

## What Devices Do

Each device maintains a persistent connection to its data source and performs two core operations on a configurable scan cycle:

- **Read** — collect current values from the device's tags (inputs)
- **Write** — push computed values back to the device's tags (outputs)

The scan cycle repeats at the device's **scan rate** (configurable from 0.1 to 3,600 seconds). Between scans, Koios monitors the connection health and automatically retries on transient failures.

## Supported Protocols

Koios supports several industrial and data protocols — OPC-UA, Modbus TCP, EtherNet/IP, SOAP, REST, and Microsoft SQL. Each protocol defines how Koios communicates with the device and what configuration is required.

See [Protocols](https://ai-ops.com/docs/protocols/introduction.md) for a full breakdown of each protocol, when to use it, and links to protocol-specific configuration guides.

> [!TIP] Not all tags need a device
> Only **device tags** belong to a device. **Expression tags** compute values from formulas, and **in-memory tags** historize values from AI models and other services — neither requires a device connection. See [Tag Source Types](https://ai-ops.com/docs/tags/introduction.md#tag-source-types) for details.

## Device Lifecycle

A device moves through a simple lifecycle from creation to active data collection:

1. **Create** — choose a protocol, provide connection details, and set a scan rate
2. **Enable** — activate the device so the data collector begins scanning
3. **Running** — the device connects, reads/writes tags on each scan cycle, and streams live data
4. **Stopped / Failed** — a device stops when disabled, or enters a failed state if it encounters persistent connection errors

> [!NOTE] Hot Reload
> Configuration changes (scan rate, credentials, connection parameters) take effect
> without restarting the data collector service. Koios detects changes and reconnects
> automatically.

## Device Status

Every device has a real-time status that reflects its current health:

| Status | Meaning |
|--------|---------|
| **Running** | Actively scanning — connection is healthy, tags are being read/written |
| **Stopped** | Not scanning — the device is disabled or the service has not started it |
| **Failed** | An error has occurred — the device attempted to connect or scan and encountered a problem |

When a device fails, Koios records an **error code**, **error message**, and **error detail** to help you diagnose the issue. The device will automatically retry up to three times before entering a persistent failed state.

## Tags

Device tags are the individual data points on a device — a temperature sensor reading, a motor speed setpoint, a database column value. Each device tag belongs to exactly one device and inherits its protocol.

Tags have a **usage** that determines how Koios interacts with them:

- **Input** tags are read from the device on each scan
- **Output** tags are written to the device (e.g. AI model predictions sent back to a PLC)

For a deeper look at tags, see the [Tags](https://ai-ops.com/docs/tags/introduction.md) section.

## Device Sets

For scenarios requiring **redundancy**, devices can be grouped into a **device set**. A device set contains multiple devices of the same protocol, ordered by priority. If the active device fails, Koios automatically switches to the next device in the set.

Tags marked as redundant read from whichever device is currently active in the set, providing seamless failover without manual intervention.

## Key Concepts

| Concept | Description |
|---------|-------------|
| **Scan rate** | How often Koios polls the device for new data (seconds) |
| **Heartbeat** | A toggling counter that external systems can monitor to verify Koios is running |
| **On-demand scanning** | Allows AI models to trigger an immediate device read outside the normal scan cycle. See [On-Demand Scanning](https://ai-ops.com/docs/devices/on-demand-scanning.md) for device settings and [On-Demand Inference](https://ai-ops.com/docs/models/on-demand-inference.md) for the full picture |
| **Log level** | Per-device log verbosity (Debug, Info, Warning, Error) for troubleshooting |

## What's Next

- [Creating a Device](https://ai-ops.com/docs/devices/creating-getting-started.md) — step-by-step guide to adding a new device
- [On-Demand Scanning](https://ai-ops.com/docs/devices/on-demand-scanning.md) — configuring freshness and batching for AI model synchronization
- [Troubleshooting a Device](https://ai-ops.com/docs/devices/troubleshooting.md) — diagnosing and resolving device errors
