Skip to main content

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

  1. The connector reads data points from the central data store (Valkey).
  2. It listens for incoming connections from SCADA clients on a configurable TCP port.
  3. When a client connects, it can request all current data points or receive live updates as values change.
IoT Sensors → MQTT → Valkey → IEC 104 Connector → SCADA Client

The connector continuously monitors the data store for changes and pushes updates to all connected clients automatically.

Connection Details

SettingDefault
ProtocolTCP/IP
Port2404
Port Range2404–2420
ModeServer (clients connect to it)
Max ClientsUp 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:

AddressWhat It MeansRange
CASDUStation address — identifies a group or location0–65,535
IOAData point address — identifies a specific measurement0–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, IOA 100 → Temperature in Transformer Room 1
  • CASDU 150, IOA 101 → Pump Status in Transformer Room 1
  • CASDU 200, IOA 100 → Temperature in Transformer Room 2

Supported Data Types

The connector supports three IEC 104 data types:

TypeNameUsed ForExamples
Type 1Single PointOn/off statesDoor open/closed, alarm active/inactive
Type 13Measured NormalizedNormalized measurementsProportional values, percentages
Type 30Single Point with TimestampOn/off states with timeSwitch state changes with exact time
Type 36Float with TimestampMeasurementsTemperature, voltage, current, humidity

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:

  1. 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 Valkey.
  2. Command-line / TOML file — For initial startup parameters (connector ID, Valkey connection, log level). A TOML configuration file can be generated with the config-gen subcommand.

Startup Parameters

These parameters are passed via command line or TOML file when starting the connector:

ParameterDescriptionRequiredDefault
--idUnique connector ID (from the Management UI)Yes
--log-levelLog verbosity (trace, debug, info, warning, error, critical, off)Noinfo
--configPath to a TOML configuration fileNo

Redis subcommand — Connection to Valkey:

ParameterDescriptionDefault
--hostValkey host (with optional port, e.g., valkey:6379)127.0.0.1
--portValkey port (overrides port in --host)6379
--pwdValkey 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:

SettingDescriptionDefault
HostWhich network interface to listen on (0.0.0.0 = all)0.0.0.0
PortTCP port the server listens on2404
Max ConnectionsMaximum number of simultaneous client connections1

Protocol Timing Parameters:

SettingDescriptionDefault
T1Timeout for sent messages awaiting acknowledgment15 seconds
T2Timeout for sending an acknowledgment10 seconds
T3Idle timeout before a test message is sent20 seconds
KMaximum number of unacknowledged messages12
WNumber of received messages before an acknowledgment is sent8

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 Valkey. 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 Valkey, 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 Valkey data store. The backend publishes connector configuration and mapping data to Valkey under:

connectors:{CONNECTOR_ID}:config     — connector settings
connectors:{CONNECTOR_ID}:mapping — linked mapping definitions

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 only when values actually change. This keeps network traffic low while ensuring clients always have the latest data.

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

Limitations

  • Server only — The connector cannot initiate outbound connections to other IEC 104 systems.
  • Monitoring types only — Supports Type 1, 30, and 36 for reading data. Write/command operations from the SCADA side are not currently supported.
  • Single instance — Each connector instance listens on one port. Use the port range 2404–2420 if multiple instances are needed.

For technical implementation details, see the Wiki - ALP-CONNEX IEC104 Connector.