Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link-iec104

License

link-iec104 is a pure Java implementation of the IEC 60870-5-104 telecontrol network protocol, built on top of Netty for high-performance asynchronous I/O.

For questions or issues, feel free to open an issue or submit a pull request.

Features

  • Complete IEC 60870-5-104 protocol — ASDU encoding/decoding, APCI framing, and transport layer
  • Master (client) & Slave (server) roles with clean API separation
  • Netty 4 based — fully async, non-blocking NIO transport
  • All standard TypeIDs — single-point, double-point, step position, bitstring, measured values (normalized/scaled/float), integrated totals, protection events, file transfer, and more
  • Command types — single/double commands, regulating step commands, setpoints (normalized/scaled/float), bitstring commands, parameter activation
  • CP56Time2a / CP24Time2a timestamp support with millisecond precision
  • Redundancy groups — multiple connections per group, automatic failover
  • Periodic tasks — general/counter interrogation, clock synchronization, configurable per group
  • File transfer — directory listing, file download, file upload, and file delete
  • Java 8 compatible

Usage

Build & Install Locally

git clone https://github.com/openlink2/java-link-iec104.git
cd java-link-iec104
mvn clean install -pl link-iec104 -DskipTests

Then add the dependency to your pom.xml:

<dependency>
    <groupId>com.openlink2</groupId>
    <artifactId>link-iec104</artifactId>
    <version>1.0.1</version>
</dependency>

Quick Start

Master (Client)

MasterConfig config = new MasterConfig("127.0.0.1", 2404)
        .setCommonAddress(1)
        .setGiInterval(30);

Iec104Master master = Iec104.newMaster(config);

master.setDataListener(asdu -> {
    System.out.println("Received: " + asdu.getTypeId());
});

master.setConnectionListener(connected -> {
    if (connected) {
        System.out.println("Connected");
        master.sendInterrogation();
    }
});

master.connect();

Slave (Server)

SlaveConfig config = new SlaveConfig()
        .setPort(2404)
        .setCommonAddress(1);

Iec104Slave slave = Iec104.newSlave(config);

slave.setDataListener(asdu -> {
    System.out.println("Received: " + asdu.getTypeId());
    // Process interrogation, command, etc.
});

slave.start();

Build

Requires JDK 8+ and Maven 3.

mvn clean package -DskipTests

The core library JAR will be in link-iec104/target/.

Example Application

The link-iec104-example module is a Spring Boot web application with a REST API and a simple web-based dashboard. It demonstrates core library usage and serves as a quick testing panel for IEC 104 masters and slaves.

cd link-iec104-example
mvn spring-boot:run

Open http://localhost:8090 in your browser.

License

This project is licensed under the Apache License, Version 2.0 — see the LICENSE file for details.

About

Complete, pure-Java IEC 60870-5-104 (IEC 104) protocol library on async Netty I/O. Master + Slave, all standard TypeIDs & commands, full timer/flow-control state machine, redundancy & file transfer — fast, robust, and production-hardened.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages