IEC 104 Connector
What Is It?
The IEC 104 Connector makes your IoT sensor data available to industrial control systems (SCADA). It acts as a server that SCADA clients can connect to in order to read real-time process data — such as temperatures, voltages, or switch states — using the widely adopted IEC 60870-5-104 standard.
In short: the IEC 104 Connector is the outbound gateway that delivers your data to control rooms and monitoring systems.
How It Works
- The connector reads data points from the central data store.
- It listens for incoming connections from SCADA clients on a configurable TCP port.
- When a client connects, it can request all current data points or receive live updates as values change.
IoT Sensors → MQTT → Data Store → IEC 104 Connector → SCADA Client
The connector continuously monitors the data store for changes and pushes updates to all connected clients automatically.
Connection Details
| Setting | Default |
|---|---|
| Protocol | TCP/IP |
| Port | 2404 |
| Port Range | 2404–2420 |
| Mode | Server (clients connect to it) |
| Max Clients | Up to 100 simultaneous connections |
The connector only operates as a server. It does not connect to other IEC 104 systems as a client.
IEC 104 Addressing
Every data point in the IEC 104 protocol is identified by two addresses:
| Address | What It Means | Range |
|---|---|---|
| CASDU | Station address — identifies a group or location | 0–65,535 |
| IOA | Data point address — identifies a specific measurement | 0–16,777,215 |
The combination of CASDU and IOA must be unique across the system. Think of CASDU as the "building" and IOA as the "sensor" within that building.
Example:
- CASDU
150, IOA100→ Temperature in Transformer Room 1 - CASDU
150, IOA101→ Pump Status in Transformer Room 1 - CASDU
200, IOA100→ Temperature in Transformer Room 2
Supported Data Types
The connector supports the following IEC 104 data types:
Monitoring types (inbound data):
| Type | Name | Used For | Examples |
|---|---|---|---|
| Type 1 | Single Point | On/off states | Door open/closed, alarm active/inactive |
| Type 3 | Double Point | Two-bit states | Breaker open/closed/transit/invalid |
| Type 13 | Measured Normalized | Normalized measurements | Proportional values, percentages |
| Type 30 | Single Point with Timestamp | On/off states with time | Switch state changes with exact time |
| Type 31 | Double Point with Timestamp | Two-bit states with time | Breaker state changes with exact time |
| Type 32 | Step Position with Timestamp | Transformer tap positions | -64 to 63 |
| Type 36 | Float with Timestamp | Measurements | Temperature, voltage, current, humidity |
Command types (outbound control):
| Type | Name | Used For | Examples |
|---|---|---|---|
| Type 45 | Single Command | On/off commands | true/false |
| Type 46 | Double Command | Open/close/stop commands | 0–3 (not permitted, off, on, not permitted) |
| Type 47 | Regulating Step Command | Step up/down commands | 0–3 (not permitted, lower, higher, not permitted) |
| Type 50 | Set-point Normalized | Analog set-point values | Floating-point set-points |
Recommendation: Use Type 36 for analog measurements and Type 30 for binary states. Both include a timestamp for traceability.
Configuration
The connector is configured in two ways:
- Management UI / API — The primary method. When you create an IEC 104 connector in the Management UI, the configuration (network settings, protocol parameters, linked mappings) is stored in the database and automatically pushed to the connector via the data store.
- Command-line / TOML file — For initial startup parameters (connector ID, data store connection, log level). A TOML configuration file can be generated with the
config-gensubcommand.
Startup Parameters
These parameters are passed via command line or TOML file when starting the connector:
| Parameter | Description | Required | Default |
|---|---|---|---|
--id | Unique connector ID (from the Management UI) | Yes | — |
--log-level | Log verbosity (trace, debug, info, warning, error, critical, off) | No | info |
--config | Path to a TOML configuration file | No | — |
Redis subcommand — Connection to the data store:
| Parameter | Description | Default |
|---|---|---|
--host | Data store host (with optional port, e.g., datastore:6379) | 127.0.0.1 |
--port | Data store port (overrides port in --host) | 6379 |
--pwd | Data store password | — |
Managed Settings (via Management UI)
The following settings are configured through the Management UI and pushed to the connector automatically. You do not need to set them manually.
Network Settings:
| Setting | Description | Default |
|---|---|---|
| Host | Which network interface to listen on (0.0.0.0 = all) | 0.0.0.0 |
| Port | TCP port the server listens on | 2404 |
| Max Connections | Maximum number of simultaneous client connections | 1 |
Protocol Timing Parameters:
| Setting | Description | Default |
|---|---|---|
| T1 | Timeout for sent messages awaiting acknowledgment | 15 seconds |
| T2 | Timeout for sending an acknowledgment | 10 seconds |
| T3 | Idle timeout before a test message is sent | 20 seconds |
| K | Maximum number of unacknowledged messages | 12 |
| W | Number of received messages before an acknowledgment is sent | 8 |
In most cases, the default timing parameters do not need to be changed. Only adjust them if your SCADA system vendor recommends specific values.
Dynamic Configuration Updates
When you change a connector's settings or linked mappings in the Management UI, the backend pushes the updated configuration to the data store. The connector detects the change and automatically restarts its services with the new configuration — no manual restart required.
Configuration Error Handling
The connector includes robust error handling for configuration issues:
- Invalid configuration — If the connector receives an invalid configuration from the data store, it logs a detailed error message and continues running with the previous valid configuration.
- Partial failures — Network interruptions or malformed data are handled gracefully without crashing the connector.
- Recovery — Once a valid configuration is published, the connector automatically picks it up and reconfigures itself.
Check the connector logs for specific error details when troubleshooting configuration issues.
Data Store Integration
The connector reads data points from the central data store. The backend publishes connector configuration and mapping data to the data store under:
connectors:{CONNECTOR_ID}:config — connector settings (including stream configuration)
connectors:{CONNECTOR_ID}:mapping — linked mapping definitions
The connector's data streams (input, output, error) are configured via the Management UI and included in the published configuration. The input stream is used to receive data point updates from other connectors.
Process image data points are stored under:
process:image:casdu:{CASDU}:ioa:{IOA}
When a value changes in the data store, the connector automatically pushes the update to all connected SCADA clients.
Client Interaction
Initial Data Request
When a SCADA client connects and sends a "General Interrogation" request, the connector responds with all current data points. This gives the client a complete snapshot of the current system state.
Live Updates
After the initial data dump, the connector sends updates whenever new data is written to the data store. Each update is forwarded to all connected SCADA clients immediately.
Cause of Transmission (CoT)
The connector forwards the Cause of Transmission (CoT) from the original data point. For example, if a data point was written with CoT "spontaneous", that same CoT is sent to the SCADA client. This preserves the semantic meaning of each update through the entire data pipeline.
Connection Monitoring
The connector and connected clients exchange periodic test messages to verify the connection is still alive. If a client disconnects, its session is cleaned up automatically.
Tested Compatibility
The IEC 104 Connector has been tested with the following SCADA systems and devices:
- Siemens RTU A8000 (ETI4)
- Vivavis HIGHLEIT
- PSIcontrol
Connector Health Reporting
The connector publishes its operational state to the central data store, enabling the Management UI to display real-time health information:
| State | Meaning |
|---|---|
| Starting | The connector is initializing and loading configuration |
| Running | The connector is connected and processing data normally |
| Error | Configuration loading failed or a critical error occurred |
| Stopped | The connector is shutting down gracefully |
The connector also reports its software version at startup, which is visible in the Management UI.