Convert Figma logo to code with AI

eclipse-milo logomilo

Eclipse Milo™ - an open source implementation of OPC UA (IEC 62541).

1,185
434
1,185
7

Top Related Projects

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0

Quick Overview

Eclipse Milo is an open-source implementation of OPC UA (Open Platform Communications Unified Architecture) for Java. It provides a complete stack for building OPC UA clients and servers, enabling industrial automation and IoT applications to communicate using this standardized protocol.

Pros

  • Comprehensive implementation of OPC UA in Java
  • Actively maintained with regular updates and bug fixes
  • Supports both client and server-side development
  • Well-documented with examples and extensive JavaDoc

Cons

  • Steep learning curve for those unfamiliar with OPC UA
  • Can be complex to set up and configure for advanced use cases
  • Limited support for some newer OPC UA features compared to commercial alternatives
  • Performance may not be optimal for high-throughput scenarios

Code Examples

  1. Creating an OPC UA client and connecting to a server:
OpcUaClientConfigBuilder cfg = new OpcUaClientConfigBuilder();
cfg.setEndpoint(new EndpointDescription(serverUrl, EndpointConfiguration.DEFAULT_CONFIGURATION));

OpcUaClient client = OpcUaClient.create(cfg.build());
client.connect().get();
  1. Reading a value from a node:
NodeId nodeId = new NodeId(2, "MyVariable");
DataValue value = client.readValue(0.0, TimestampsToReturn.Both, nodeId).get();
System.out.println("Value: " + value.getValue().getValue());
  1. Writing a value to a node:
NodeId nodeId = new NodeId(2, "MyVariable");
DataValue newValue = new DataValue(new Variant(42));
StatusCode result = client.writeValue(nodeId, newValue).get();
System.out.println("Write result: " + result);
  1. Subscribing to data changes:
UaSubscription subscription = client.getSubscriptionManager().createSubscription(1000.0).get();
ReadValueId readValueId = new ReadValueId(nodeId, AttributeId.Value.uid(), null, QualifiedName.NULL_VALUE);
MonitoringParameters parameters = new MonitoringParameters(uint(1), 1000.0, null, uint(10), true);
MonitoredItemCreateRequest request = new MonitoredItemCreateRequest(readValueId, MonitoringMode.Reporting, parameters);

subscription.createMonitoredItems(TimestampsToReturn.Both, Arrays.asList(request), (item, id) -> {
    item.setValueConsumer(value -> System.out.println("Value received: " + value.getValue().getValue()));
}).get();

Getting Started

To use Eclipse Milo in your Java project, add the following dependencies to your Maven pom.xml:

<dependencies>
    <dependency>
        <groupId>org.eclipse.milo</groupId>
        <artifactId>sdk-client</artifactId>
        <version>0.6.8</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.milo</groupId>
        <artifactId>sdk-server</artifactId>
        <version>0.6.8</version>
    </dependency>
</dependencies>

For Gradle, add these to your build.gradle:

dependencies {
    implementation 'org.eclipse.milo:sdk-client:0.6.8'
    implementation 'org.eclipse.milo:sdk-server:0.6.8'
}

After adding the dependencies, you can start using Eclipse Milo in your Java code as shown in the examples above.

Competitor Comparisons

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0

Pros of open62541

  • Written in C, offering better performance and lower resource usage
  • Highly portable, suitable for embedded systems and resource-constrained environments
  • Provides a single-file distribution option for easy integration

Cons of open62541

  • Less feature-rich compared to Milo
  • Steeper learning curve for developers not familiar with C programming
  • Limited built-in security features compared to Milo's Java-based implementation

Code Comparison

open62541 (C):

UA_Server *server = UA_Server_new();
UA_ServerConfig_setDefault(UA_Server_getConfig(server));
UA_StatusCode retval = UA_Server_run(server, &running);
UA_Server_delete(server);

Milo (Java):

OpcUaServer server = OpcUaServer.builder().build();
server.startup().get();
server.shutdown().get();

Both examples demonstrate basic server creation and lifecycle management. open62541 uses a more C-style approach with explicit memory management, while Milo leverages Java's object-oriented features and garbage collection.

open62541 is better suited for embedded systems and performance-critical applications, while Milo offers a more developer-friendly experience with a richer feature set. The choice between the two depends on the specific requirements of the project, target environment, and developer expertise.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Eclipse Milo

Jenkins Maven Central

Milo is an open-source implementation of OPC UA (currently targeting 1.03). It includes a high-performance stack (channels, serialization, data structures, security) as well as client and server SDKs built on top of the stack.

Stack Overflow tag: milo

Mailing list: https://dev.eclipse.org/mailman/listinfo/milo-dev

Maven

Building Milo

Using JDK 8, run mvn clean install from the project root.

To maintain compatibility with Java 8 it is recommended that you build using JDK 8, however the library is runtime compatible with versions 8 and later (e.g. JDK 11, JDK 17).

Releases

Releases are published to Maven Central and snapshots to Sonatype.

OPC UA Client SDK

<dependency>
    <groupId>org.eclipse.milo</groupId>
    <artifactId>sdk-client</artifactId>
    <version>0.6.15</version>
</dependency>

OPC UA Server SDK

<dependency>
    <groupId>org.eclipse.milo</groupId>
    <artifactId>sdk-server</artifactId>
    <version>0.6.15</version>
</dependency>

Referencing a SNAPSHOT release requires the Sonatype snapshot repository be added to your pom file:

<repository>
    <id>oss-sonatype</id>
    <name>oss-sonatype</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

Public Demo Server

An internet-facing demo server is accessible at opc.tcp://milo.digitalpetri.com:62541/milo.

It accepts both unsecured and secured connections. Before connecting with security you must upload your client's DER-encoded X509 certificate using the form at http://milo.digitalpetri.com.

Authenticate anonymously or with one of the following credential pairs:

  • user1 / password
  • user2 / password
  • admin / password

The code powering the demo server is available here: https://github.com/digitalpetri/opc-ua-demo-server