Skip to content
CLI tools

opcuactl

Discover, browse, read, write, call methods, monitor, handle alarms, manage certificates, read and edit history, work with OPC UA PubSub, and run a test server.

Install

Linux and macOS

curl -fsSL https://get.otfabric.io/opcuactl | sh

Windows (PowerShell)

irm https://get.otfabric.io/opcuactl.ps1 | iex

CI, containers and device images

curl -fsSL https://get.otfabric.io/opcuactl | env OTF_UNMANAGED_INSTALL=/usr/local/bin sh

One static binary for Linux (x86-64, ARM64, ARMv7), macOS (Intel, Apple silicon) and Windows (x86-64, ARM64), with no runtime to install. The installer checks the release's SHA-256 checksum, installs per user without sudo, and upgrades in place when you run it again. Pin a release withOTF_VERSION. All install options. To build from source: go install github.com/otfabric/opcuactl@latest.

First commands

# Discover servers and list their endpoints
opcuactl discover servers -e opc.tcp://localhost:4840
opcuactl discover endpoints -e opc.tcp://localhost:4840

# Browse the address space
opcuactl browse children -e opc.tcp://localhost:4840

# Read a value
opcuactl get value -e opc.tcp://localhost:4840 -n i=2258

# Monitor live value changes
opcuactl monitor value -e opc.tcp://localhost:4840 -n i=2258

# Listen to OPC UA PubSub on a UDP multicast group
opcuactl pubsub subscribe --url opc.udp://224.0.0.22:4840

# No server at hand: a test server with a demo address space
opcuactl serve

The opcuactl guide walks through every command group, connection option and safety rule.

For scripts, CI and containers

opcuactl is as easy to read for a pipeline as for a person. It follows the same conventions as every OT Fabric tool, so a script written for one protocol carries over to the next.

The exit-code table
CodeMeaning
0Success
1Findings: the command completed and its result reports problems, such as a file that does not validate or a diagnosis with a failing check
2Usage: unknown command or flag, a missing argument
3Invalid input: a flag value, a file or a combination that does not make sense. Nothing was sent
4Transport: the connection could not be made, or was lost
5Timeout: the device did not answer in time
6Protocol: the device refused the request, or broke the protocol
7Partial success: a valid result was written, and it holds failures
8Unsupported: the device, or this platform, does not support what was asked
9Permission: the device or the operating system refused, such as raw-socket access without the capability
10Output or internal error
130Interrupted by Ctrl-C or SIGTERM before a result

Each tool uses the codes that apply to it; a code never changes meaning between tools.

In a Dockerfile

FROM debian:bookworm-slim
RUN apt-get update \
 && apt-get install -y --no-install-recommends ca-certificates curl \
 && curl -fsSL https://get.otfabric.io/opcuactl \
    | env OTF_UNMANAGED_INSTALL=/usr/local/bin sh \
 && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["opcuactl"]

Scripts, CI and containers has GitHub Actions and GitLab CI examples and shows how to use a simulator as a test fixture.

Protocols

The README on GitHub has the full feature list, examples and changelog.

go-opcua

OPC UA client and server over TCP, WebSockets and HTTPS, in UA Binary and UA JSON: RSA and ECC security, subscriptions, alarms and conditions, data and event history, GDS certificate management and PubSub.

go get github.com/otfabric/go-opcua

opcua-interop

OPC UA reference clients and servers: open62541, Eclipse Milo, async-opcua, UA-.NETStandard (with its GDS), node-opcua and opcua-asyncio.