On this page
IEC 104 master
This plugin connects to an IEC 60870-5-104 (IEC104) outstation, runs general interrogation, receives reported data, synchronizes time, and issues approved single or double commands. It is named IEC 104 master in the device selector.
See Collection Configuration for common channel, device, variable, and data-format settings. This page covers only IEC104 settings, addresses, special methods, and debug tools.
Compatible devices and models
| Device series / model examples | Connection requirements |
|---|---|
| RTUs, protection devices or telecontrol gateways providing IEC 60870-5-104 servers | Configure TCP connection, common address and information object address. Match ASDU types, causes of transmission and control procedures to the point list. |
Prepare points in the RTU or slave software
- Configure the slave listening IP and TCP port and record its CA. Port
2404is common; use the actual configured port. A server can expose multiple CAs. - Prepare a short-floating-point point:
CA=1,TypeId=13,IOA=100, value12.5, with interrogation and spontaneous-report behavior. Record group 1–16 if group interrogation is used. - Connect a gateway TCP client and create a Float variable at
ca=1;type=13;ioa=100. A timestamped short float usestype=36, even if its numeric value is identical. - Confirm STARTDT, interrogation termination and the point value. Change the source to
15.5and check a new report and variable timestamp. TESTFR alone establishes only link-test success.
Interrogation and queue parameters
group=1 corresponds to QOI 21; omit group for ungrouped points. Device Common address supplies a default for manual commands, not the required ca in each variable address.
K limits unacknowledged I frames and T3 controls idle tests; neither is the measurement update period. Interrogation timeout must cover activation through termination. Check complete point transfer and termination before increasing it. Match each TypeId to the source point list and use the control sequence below for commands.
Establish the master connection
Open the plugin
Open Development Configuration → Collection Configuration, create a TCP client channel, then create a device using IEC 104 master.
Supported scope
| Item | Description |
|---|---|
| Channel | TCP client. |
| Data types | Boolean, Byte, common signed/unsigned integers, Float, Double, and String. |
| Writable types | Single commands 45/58 and double commands 46/59. Other types are collected only. |
Plugin properties
| Setting | Default | Range | Description |
|---|---|---|---|
| Common address | 1 | 1 to 65534 | Default for manual commands; collection variable addresses must include ca. |
| Send window K | 12 | 1 to 32767 | Maximum unacknowledged transmitted I-frames. |
| Interrogation retry count | 0 | 0 or greater | Retries after a failed general interrogation. |
| Idle test interval T3 | 20000 ms | 1 to 2147483647 | Link-test interval after the connection becomes idle. |
| Interrogation completion timeout | 180000 ms | 1 to 2147483647 | Maximum wait from activation to termination for general or group interrogation. |
The master acknowledges each valid I-frame immediately with an S-frame (W=1), before processing point data. Acknowledgements bypass the configured send delay. W and T2 are not configurable plugin properties.
SOE event storage
Expand SOE event storage to retain events for time, CA and IOA queries. Configure the connection and table before enabling it. Live point updates, event storage and the IEC104 file-transfer directory are separate settings.
| Storage field | Value and purpose |
|---|---|
Name / Enable | Name defaults to IEC104; Enable defaults to false. Disabled storage does not create this device’s event database connection. |
DbType | Default Sqlite; supports MySql, SqlServer, Sqlite and PostgreSql. Select the actual database type. |
BigTextConnectStr | Default Data Source=IEC104_SOE.db;Pooling=False. The gateway service accesses the SQLite file. For a remote database enter its address, database and account; table-creation and write access are required. |
TableName | Default iec104SoeEventLog, required. Do not share it with a historical-variable table using another row structure. |
SplitTable | Default None; alternatives are Day, Week, Month, Quarter and Year. Select for event volume and query periods; custom periods are unsupported. |
SaveDays | Default 3650 days; 0 disables automatic cleanup. Events older than the configured period are removed. |
TimeZoneId | Default +08:00; empty writes UTC. Match the CP56Time2a timezone convention and query ranges to avoid treating a timezone offset as transport delay. |
CacheEnable | Default false. Enables CacheDB outbound caching during target-database failures and forwarding after recovery. |
QueueMaxCount | Default 100000 rows. Buffers event bursts in memory; it does not increase IEC104 send window K. |
CacheFileMaxLength | Default 262144 rows. Limits outbound cached rows, not the size of the target event table. |
SplitSize | Default 2000 rows per database batch. It does not change interrogation point count, ASDU size or outstation reporting cadence. |
After enabling storage, reopen the device and check storage initialization, then query Protocol Debug → SOE Events. Use the configured timezone and compare device event time separately from gateway receive time.
Addresses and commands
Address rules
Use ca=common address;type=type identifier;ioa=information object address. All values are decimal.
| Part | Range | Description |
|---|---|---|
ca | 1 to 65534 | Common address. |
type | 1 to 255 | IEC104 type identifier. |
ioa | 0 to 16777215 | Information object address. |
group | 1 to 16 | Optional interrogation group, matching the outstation configuration. Maps to QOI 21 through 36. Omit this segment for an ungrouped point; zero and empty values are invalid. |
Example: ca=1;type=13;ioa=100;group=1. Values are updated by interrogation or spontaneous reports. Variable writes support only type=45/58 single commands and type=46/59 double commands.
In Edit fields, select the short-floating measurement type, CA 1 and IOA 100. Leave interrogation group unset for an ungrouped point; otherwise use the source point’s actual group. Normally leave data-conversion overrides unset for protocol-decoded measurements.
Special methods
Choose the method under the variable’s Special Method field and enter the listed arguments in the variable address field.
| Selector value | Purpose | Arguments |
|---|---|---|
GeneralInterrogationAsync | Run general interrogation | qualifier,common address |
TestLinkAsync | Run a link test | None |
SynchronizeClockAsync | Synchronize outstation time | timestamp,common address |
SelectSingleCommandAsync | Select a single command | full address,state,time tag |
ExecuteSingleCommandAsync | Execute a single command | full address,state,time tag |
SelectDoubleCommandAsync | Select a double command | full address,state,time tag |
ExecuteDoubleCommandAsync | Execute a double command | full address,state,time tag |
Parameters, periodic transmission, and files
Device methods load normalized, scaled, and short floating measured parameters (TypeId 110/111/112). Match the parameter kind to the peer configuration. A successful confirmation returns the active value. Parameters apply immediately; there is no staged batch commit.
Set periodic transmission uses QPA=3 to enable or stop an explicitly configured object by common address and IOA. A successful stop confirmation ends periodic frames for that object. Reads, interrogation, and spontaneous reports follow their own configuration. A peer without the requested periodic object rejects the request.
Use the device method entry for file operations:
| Method | Arguments |
|---|---|
| Read file directory | Common address, IOA; 0 requests the complete directory for that common address. |
| Download IEC104 file | Common address, IOA, two-byte numeric file name, local relative path. |
| Upload IEC104 file | Common address, IOA, two-byte numeric file name, local relative path. |
File directory defaults to ProtocolFiles/IEC104/Devices/{DeviceId} under the gateway backend runtime root. Place upload sources there and find successful downloads there. Relative paths use /; absolute paths, parent traversal, and symbolic links are rejected. The numeric protocol file name and local filename are configured separately.
File transfer limits default to 8 MiB per file, 64 KiB per section, 255 sections, 256 directory entries, a 120-second total deadline, and a 10-second idle timeout. Transfers validate lengths, section numbers, and section/file checksums. Downloads atomically replace the local destination before confirming success. Validation failure and cancellation before commit preserve the old file. If confirmation is lost after commit, the file may already have changed; verify the result before retrying. File methods share the current connection with ordinary commands. Cancellation, disconnect, and transfer errors terminate the transaction without automatically replaying content. Current device and method permissions are checked during transfer and commit.
The application test uses TypeId 107 and matches both counter and timestamp. Process reset and delay acquisition require an actual peer implementation; the gateway server currently returns negative confirmations for these two services.
Debug and verify
Device debug
Open Development Configuration → Collection Configuration, select the IEC104 device, then open Debug → Protocol Debug · IEC 104 master.
| Feature | Purpose |
|---|---|
| Core status | Shows CA, K/W, sequence numbers, frame counters, unacknowledged frames and the latest error; runs a link test. |
| Points & Interrogation | Runs general or counter interrogation and single-point reads; shows paged values, quality and timestamps by CA, TypeId and IOA. |
| Report Monitor | Shows paged spontaneous and interrogation reports, with expandable point values. |
| Remote control | Sends select or execute commands for control types 45–51 or 58–64. |
| System Commands | Synchronizes the clock and sends application tests, process-reset and delay-acquisition commands. The outstation must implement the requested service. |
| Messages | Shows protocol messages, errors and request/response summaries. |
Link and interrogation
Run Link Test first, then enter the interrogation qualifier and common address and run General Interrogation. The protocol result should show a valid outstation confirmation.
Report monitor
Inspect the report’s type, cause of transmission, CA and point count, then expand its point details. Match the same CA, TypeId and IOA to the variable.
SOE events
Use SOE events to query timestamped events by time range, common address and information object address. Compare device event time with reception time when diagnosing a clock offset or transport delay.
Clock synchronization
Verify the timestamp and common address before synchronizing. This changes the outstation clock, so first verify the gateway time zone and system time.
Remote control
Choose the actual Command type, such as 45 C_SC_NA_1, then enter the common address, information object address, command qualifier and control value. A single command uses false or true; a double command uses 1 or 2. Match any time tag to the selected timestamped type. For select-before-operate, run Remote control select and wait for success before Execute command.
A remote command changes field equipment state. Verify ca, type, ioa, target value, and interlocks before confirming the high-risk operation.
Interrogation scheduling
On initial connection and reconnection, the master runs one general interrogation (QOI=20) per common address. All read plans for that address share this initialization.
If every collected protocol variable has a group, periodic requests are grouped by common address, interrogation group, and packing interval. Group 1 uses QOI=21; group 16 uses QOI=36. Different intervals within one group create separate read plans.
If even one collected protocol variable omits group, all periodic requests for the device use general interrogation, grouped by common address and packing interval. Disabled, write-only, and special-method variables do not affect this decision. The interval comes from the variable, or the device default when the variable interval is empty. Spontaneous reports continue updating values in both cases.
Verify the configuration
- Run Link Test and confirm a valid outstation response.
- Run one general interrogation and confirm configured variables update under the expected common address.
- Verify that reported variables continue to update.
- Test remote control only with site approval and satisfied interlocks.
Parameters and files
In Parameters and files, enter the target common address (CA) and information object address (IOA) before choosing an operation. These tools require special-method execution permission and enabled device method calls.
- Load measurement parameter: choose Normalized, Scaled or ShortFloating encoding and the threshold, filter time constant or transmission limit. Confirm the target and value. The result contains the actual parameter acknowledged by the device, including protocol quantization.
- Cyclic transmission: select Enabled or Stopped and confirm the explicit IOA. The device must implement the corresponding cyclic transmission object.
- File transfer: read the directory, then use an entry to fill its complete CA, IOA and protocol file number. Selection starts no transfer. Enter a relative path on the device backend, then choose Download to gateway or Upload to device. This path belongs to the directory configured for the device, not the browser’s local filesystem. Upload uses an existing backend file.
Directory queries and transfers each have their own CA and IOA. The Protocol file number is the numeric identifier returned by the outstation. A relative path such as records/file.bin identifies a file within the gateway’s configured directory; it does not replace the protocol file number.
Success requires complete protocol confirmation and, for downloads, atomic file publication. Timeouts, rejections and uncertain results are not replayed automatically. Check the device and file state before deciding what to do next.
Troubleshooting
| Symptom | Check |
|---|---|
| Link test fails | TCP channel, outstation port, network, and existing connection ownership. |
| Interrogation returns no data | Common address, qualifier, group assignment, and outstation point list. |
| Variable does not update | ca, type, ioa, data type, and reported-data configuration. |
| Command is rejected | Command type, select/execute order, target value, time tag, outstation permission, and equipment interlock. |
| Frequent disconnects | Send window K, idle interval T3, prompt S-frame acknowledgements, timeout settings, and network quality. Increase the packing interval if requests are too frequent. |
Related links
- Collection Configuration: Common channels, devices, variables, and data format.
- Plugin Manual Index: Other collection and data-forwarding plugins.









