#opc-ua

opcua-core

Core components for OPC UA used by client and server

11 releases (breaking)

0.9.1 Apr 7, 2022
0.9.0 Mar 20, 2022
0.8.1 Aug 24, 2021
0.8.0 Oct 10, 2020
0.1.0 Jul 5, 2017

#1128 in Embedded development

Download history 16/week @ 2024-07-22 25/week @ 2024-07-29 9/week @ 2024-08-19 46/week @ 2024-08-26 20/week @ 2024-09-02 7/week @ 2024-09-09 14/week @ 2024-09-16 33/week @ 2024-09-23 66/week @ 2024-09-30 22/week @ 2024-10-07 16/week @ 2024-10-21 33/week @ 2024-10-28 8/week @ 2024-11-04

58 downloads per month
Used in 2 crates

MPL-2.0 license

4MB
64K SLoC

Introduction

This is an OPC UA server / client API implementation for Rust.

Linux
Windows

OPC UA is an industry standard for monitoring of data. It's used extensively for embedded devices, industrial control, IoT, etc. - just about anything that has data that something else wants to monitor, control or visualize.

Rust is a systems programming language and is therefore a natural choice for implementing OPC UA. This implementation supports the embedded, micro and nano profiles but may grow to support features in time.

Read the compatibility page for how the implementation conforms with the OPC UA spec.

Read the change log for changes per version as well as aspirational / upcoming work.

License

The code is licenced under MPL-2.0. Like all open source code, you use this code at your own risk.

Setup

Read the setup for instructions on building OPCUA for Rust.

Read cross compilation for hints for cross compiling OPC UA for Rust to other platforms.

Design

Read the design for more in-depth description of implementation.

Tutorial

Tutorials / user guides are still work in progress.

Further Documentation

The API documentation is generated from the latest published crates. This may be some way behind current development.

Client Client side APIs to connect to an OPC UA server.
Server Server side APIs to host an OPC UA server, address space, create new nodes, subscriptions.
Crypto Security profiles, encryption, hashing, signing / verification, certificate management.
Core Core functionality shared by client and server - Secure channel, TCP encoding, TCP messages, chunking.
Types OPC UA core types and binary encoding implementations.

Samples

If you want to get stuck in, there are a number of samples in the samples/ folder. The simple-client and the simple-server projects are minimal client and server programs respectively.

# In one bash
cd opcua/samples/simple-server
cargo run
# In another bash
cd opcua/samples/simple-client
cargo run

The full list of samples:

  1. simple-server - an OPC UA server that adds 4 variables v1, v2, v3 and v4 and updates them from a timer via push and pull mechanisms.
  2. simple-client - an OPC UA client that connects to a server and subscribes to the values of v1, v2, v3 and v4.
  3. discovery-client - an OPC UA client that connects to a discovery server and lists the servers registered on it.
  4. chess-server - an OPC UA server that connects to a chess engine as its back end and updates variables representing the state of the game.
  5. demo-server - an OPC UA server that is more complex than the simple server and can be used for compliance testing.
  6. mqtt-client - an OPC UA client that subscribes to some values and publishes them to an MQTT broker.
  7. web-client - an OPC UA client that subscribes to some values and streams them over a websocket.
  8. modbus-server - an OPC UA server that translates variables from MODBUS.

Dependencies

~12–21MB
~317K SLoC