Skip to content

IEC 60870-5-104 connector Basic & Scale ​

The IEC 60870-5-104 connector makes ConnectMQ Edge a controlling station (master/client) for RTUs and substation gateways. It receives spontaneous data and general interrogation responses, sends commands and setpoints, and publishes every signal to your ConnectMQ broker as ISA-95 JSON.

Supported devices ​

RTUs, substation gateways and other IEC 104 controlled stations on TCP port 2404. The protocol stack is built into ConnectMQ Edge.

ConceptIEC 104 meaning
ChannelOne TCP session. Backup servers can be listed; only one connection is active (STARTDT) at a time
DeviceOne common address (ASDU address). One connection can carry several common addresses
TagOne information object address (IOA)
LimitValue
Channels (IEC 104 driver)1024
Devices (common addresses) per channel1024

The connector is event-driven: spontaneous data (COT 3), general interrogation responses and periodic data update the tags directly. Limits are per driver, not per project. How many values you can send to the cloud depends on your plan: see Plans & broker limits and pricing.

Supported ASDU types ​

Monitoring direction: M_SP_NA/TA/TB (single point), M_DP_NA/TA/TB (double point), M_ST_NA/TA/TB (step position), M_BO_NA/TA/TB (32-bit string), M_ME_NA/TA/TD/ND (normalized), M_ME_NB/TB/TE (scaled), M_ME_NC/TC/TF (short float), M_IT_NA/TA/TB (integrated totals), M_EI_NA_1 (end of initialization).

Control direction: C_SC_NA/TA (single command), C_DC_NA/TA (double command), C_RC_NA/TA (regulating step), C_SE_NA/TA, C_SE_NB/TB, C_SE_NC/TC (normalized/scaled/float setpoint), C_BO_NA/TA (32-bit string), C_IC_NA_1 (general/group interrogation), C_CI_NA_1 (counter interrogation), C_CS_NA_1 (clock synchronization).

Quality descriptors map to the ConnectMQ quality field: IV → bad, NT → stale, SB/BL/OV → uncertain. CP56Time2a/CP24Time2a time tags are used as the tag timestamp (the receive time is used when the time tag is flagged invalid).

Prepare the RTU ​

  • From the RTU or gateway configuration note the IP address, port (2404), the common address (ASDU address) and the IOA list of the signals with their types.
  • Many RTUs accept only configured masters: add the Edge PC's IP address to the RTU's allowed client list.
  • Check the network: Test-NetConnection 10.0.10.21 -Port 2404 in PowerShell.
  • Old or non-standard RTUs: ask for the COT size, common address size and IOA size (usually 2 / 2 / 3).

Add the connector in ConnectMQ Edge ​

Add a channel from the template ​

In the ConnectMQ Edge desktop app open Connectors in the left menu, click + Add channel and pick the IEC 60870-5-104 template. The channel is added with sample addresses.

Enter the RTU connection ​

Set Host and Port in the channel settings. Add a redundant RTU under BackupHosts if you have one.

Add one device per common address ​

Each device is one common address (CommonAddress). Set "AutoCreateTags": true to create a tag for every IOA the RTU sends, so you do not have to type the IOA list.

Add your tags ​

Each tag is one IOA, for example 4001. Set DataType, Unit and Scale as needed. For commands, mark the tag Writable and set Command (and CommandAddress if the command IOA differs).

Validate and save ​

Click Validate project, then press Save and apply. The channel starts right away without restarting the service. Edge sends a general interrogation on every connect.

Check the values ​

On Overview the devices show Reading data under Field devices; problems appear in the Last problem column. Live values are on Local OPC UA Server › Live tag values, details in Windows Service Settings › Logs.

Settings reference ​

Channel settings ​

SettingDefaultDescription
HostrequiredIP address or host name of the controlled station
Port2404TCP port
BackupHosts[]Backup servers (host or host:port). When the connection drops the next one is tried; after the whole list a growing wait applies
T0Ms30000t0 – connection establishment timeout
T1Ms15000t1 – acknowledgement timeout for sent I/U frames
T2Ms10000t2 – latest acknowledgement of received I frames (t2 < t1)
T3Ms20000t3 – TESTFR after idle time
K12Max unacknowledged sent I frames
W8Acknowledge with an S frame after at most w received I frames (w ≤ k)
CotSize2Cause of transmission size (1 or 2 octets)
CommonAddressSize2Common address size (1 or 2 octets)
IoaSize3IOA size (1, 2 or 3 octets)
OriginatorAddress0Originator address (only with CotSize 2)
GiOnConnecttrueGeneral interrogation on every connect and reconnect
GiIntervalSeconds0Periodic general interrogation (0 = off)
GiOnEndOfInittrueGeneral interrogation when M_EI_NA_1 is received
CounterInterrogationIntervalSeconds0Periodic counter interrogation (0 = off)
CounterFreeze0Counter interrogation FRZ: 0 read, 1 freeze, 2 freeze and reset, 3 reset
ClockSyncOnConnectfalseClock synchronization (C_CS_NA_1) on connect
ClockSyncIntervalSeconds0Periodic clock synchronization (0 = off)
TimeIsUtctrueSent and received times are UTC (false = local time)
IgnoreDeviceTimestampsfalseUse the receive time instead of the device time tag
IgnoreSequenceErrorsfalseResynchronize on N(S)/N(R) sequence errors instead of dropping the connection (RTU compatibility)
CommandTimeoutMs10000Wait time for ACTCON/ACTTERM
WaitForActTermfalseA write waits until ACTTERM arrives

The common polling settings (DemoteAfterFailures and so on) are not used by this driver.

Non-standard RTUs: combine CotSize, CommonAddressSize, IoaSize, OriginatorAddress, IgnoreSequenceErrors, GiOnConnect, GiOnEndOfInit and TimeIsUtc. For example, an old RTU may need CotSize: 1, CommonAddressSize: 1, IoaSize: 2.

Device settings ​

SettingDefaultDescription
CommonAddress1ASDU common address (unique within the channel)
InterrogationQualifier20QOI: 20 = station interrogation, 21–36 = group 1–16
AutoCreateTagsfalseCreate an IOA tag (for example IOA4001) for every IOA that is not configured

If the station answers with COT 46 (unknown common address), the device is marked offline.

Command settings (tag Settings) ​

SettingDefaultDescription
Commandautomaticsingle, double, step, setpoint_normalized, setpoint_scaled, setpoint_float, bitstring or the IEC name (C_SC_NA_1, C_SE_NC_1…). If empty, derived from the last received monitoring type (M_SP → single command, M_ME_NC → float setpoint…), otherwise from DataType
CommandAddressAddressCommand IOA when it differs from the monitoring IOA
SelectBeforeOperatefalsetrue: select first (S/E = 1), execute after ACTCON. false: direct execute
Qualifier0QU for commands (0 default, 1 short pulse, 2 long pulse, 3 persistent); QL for setpoints
TimeTagfalseSend the time-tagged variant (C_xx_TA_1 with CP56Time2a)

Tag addresses and values ​

The tag Address is the IOA:

FormatExample
Decimal4001
With prefixioa:4001
Hexadecimal0x0FA1
Octets (low.middle.high)161.15.0

Value conversion with DataType Auto:

Information typePublished value
Single pointtrue / false
Double point0–3 (1 = OFF, 2 = ON, 0 / 3 = intermediate / indeterminate)
Step positioninteger
Normalizeddouble between -1 and +1
ScaledInt16
Short floatfloat
Integrated totalsInt32
BitstringUInt32

A double point tag with "DataType": "Boolean" publishes true for 2 (ON) and false for 1 (OFF); 0 and 3 (intermediate/indeterminate) give uncertain quality.

Example ​

A feeder in a substation with a redundant gateway. The project's ISA-95 levels are connectmq / site1, and the device sets Area: substation and Line: feeder1.

NameIOADataTypeUnitNotes
Breaker.State1001BooleanDouble point
Breaker.Command1001BooleanWritable, double command on IOA 6001, SBO
ActivePower4001Float64MWDeadband 0.05
Voltage4002Float64kVScale 0.1
Energy7001Int32kWh
PowerSetpoint8001Float32Writable, float setpoint
json
{
  "Name": "Substation",
  "Driver": "Iec104",
  "Settings": {
    "Host": "10.0.10.21",
    "Port": 2404,
    "BackupHosts": [ "10.0.10.22" ],
    "GiIntervalSeconds": 900,
    "CounterInterrogationIntervalSeconds": 3600,
    "ClockSyncOnConnect": true,
    "ClockSyncIntervalSeconds": 3600
  },
  "Devices": [
    {
      "Name": "Feeder1",
      "Isa95": { "Area": "substation", "Line": "feeder1" },
      "Settings": { "CommonAddress": 1 },
      "Tags": [
        { "Name": "Breaker.State", "Address": "1001", "DataType": "Boolean" },
        { "Name": "Breaker.Command", "Address": "1001", "DataType": "Boolean", "Writable": true,
          "Settings": { "Command": "double", "CommandAddress": 6001, "SelectBeforeOperate": true } },
        { "Name": "ActivePower", "Address": "4001", "DataType": "Float64", "Unit": "MW", "Deadband": 0.05 },
        { "Name": "Voltage", "Address": "4002", "DataType": "Float64", "Unit": "kV", "Scale": 0.1 },
        { "Name": "Energy", "Address": "7001", "DataType": "Int32", "Unit": "kWh" },
        { "Name": "PowerSetpoint", "Address": "8001", "DataType": "Float32", "Writable": true,
          "Settings": { "Command": "setpoint_float" } }
      ]
    }
  ]
}

GiIntervalSeconds: 900 repeats the general interrogation every 15 minutes. The ActivePower tag arrives in ConnectMQ on the topic (empty ISA-95 levels are skipped):

text
connectmq/site1/substation/feeder1/Feeder1/ActivePower

with this payload:

json
{
  "timestamp": "2026-10-21T14:29:00.123Z",
  "value": 12.84,
  "quality": "good",
  "unit": "MW",
  "dataType": "Float64",
  "tag": "ActivePower",
  "device": "Feeder1",
  "channel": "Substation"
}

The timestamp is the RTU's time tag when the ASDU carries one. See Topics and payloads.

Send commands and setpoints ​

Writing a Writable tag sends a command or setpoint on the same connection and waits for ACTCON (and ACTTERM if WaitForActTerm is on). A negative confirmation (P/N = 1 or COT 44–47) is reported as a write error.

CommandValues to write
Single commandtrue / false
Double commandtrue / false, 1 / 2 or "on" / "off"
Regulating step"higher" / "lower" or 2 / 1
Setpointsa number
  • From the cloud: turn on Allow writes from the cloud in Cloud Settings, then publish to the tag topic plus /set, for example {"value": 12.5} to connectmq/site1/substation/feeder1/Feeder1/PowerSetpoint/set.
  • Locally: write the tag from an OPC UA client on the Edge local OPC UA server.

Troubleshooting ​

SymptomCause and fix
No connection, timeoutPort 2404 not reachable, or the RTU only accepts known masters. Add the Edge PC's IP on the RTU and test with Test-NetConnection.
Connected, but values are missing or wrongCOT, common address or IOA size does not match. Set CotSize, CommonAddressSize and IoaSize to the RTU's values (for example 1 / 1 / 2 on old RTUs).
Connection drops with sequence errorsNon-standard RTU. Set "IgnoreSequenceErrors": true.
Device offline right after connectingThe RTU answered COT 46 (unknown common address). Check CommonAddress.
Values only arrive after changesTurn on periodic interrogation with GiIntervalSeconds (for example 900).
Timestamps shifted by hoursThe RTU sends local time. Set "TimeIsUtc": false, or "IgnoreDeviceTimestamps": true.
Command rejectedNegative confirmation from the RTU. Check Command, CommandAddress, SelectBeforeOperate and Qualifier against the RTU's configuration.
IOAs not configuredUse "AutoCreateTags": true on the device to see every IOA the RTU sends.

Known limitations ​

  • Redundancy is sequential (active plus cold standby). There is no hot standby that keeps the backup connection open in STOPDT.
  • TLS (IEC 62351-3) and file transfer (F_xx) are not supported.
  • C_RD_NA_1 (read command), C_TS_TA_1 (test command), C_RP_NA_1 (reset process) and parameter ASDUs (P_xx) are not sent.
  • M_PS_NA_1 and protection equipment events (M_EP_xx) are ignored.

Fully managed MQTT broker for connected devices.