Skip to content
CLI tools

iec61850ctl

IEC 61850 from the terminal: browse IEDs, read and write, operate controls and subscribe to reports over MMS, and sniff, subscribe to and publish GOOSE and Sampled Values on the station bus.

What it does

Install

Linux and macOS

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

Windows (PowerShell)

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

CI, containers and device images

curl -fsSL https://get.otfabric.io/iec61850ctl | 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/iec61850ctl@latest.

First commands

# List the logical devices of an IED, and the logical nodes in one
iec61850ctl list lds --host 192.0.2.10
iec61850ctl list lns --host 192.0.2.10 --ld MNSREF615LD0

# Read a measurement (FC MX)
iec61850ctl get object --host 192.0.2.10 --object MNSREF615LD0/FMMXU1.Hz.mag.f --fc MX

# Subscribe to a buffered report, until Ctrl-C
iec61850ctl subscribe report --host 192.0.2.10 --ld MNSREF615LD0 --ln LLN0 --report rcbMeasFlt01 --type BR --show-values --interrogation

# Watch GOOSE and Sampled Values on the station bus
iec61850ctl goose sniff --iface eth0 --count 5
iec61850ctl sv subscribe --iface eth0 --scl station.scd --svcb MSVCB01 --duration 10s

# Run a local MMS server from an SCL file
iec61850ctl server start --scl device.cid --host 0.0.0.0 --port 102

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

For scripts, CI and containers

iec61850ctl 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/iec61850ctl \
    | env OTF_UNMANAGED_INSTALL=/usr/local/bin sh \
 && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["iec61850ctl"]

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-iec61850

IEC 61850 in one library: MMS client and SCL-driven server, GOOSE and Sampled Values publishers and subscribers, and SCL parsing, with logical nodes, reports, controls and control blocks as first-class Go types.

go get github.com/otfabric/go-iec61850

go-mms

MMS (ISO 9506) client and server with the full ISO upper-layer stack, the transport underneath IEC 61850: typed errors, metrics, retries and graceful shutdown, fuzzed and interop tested.

go get github.com/otfabric/go-mms

go-mms-trace

Read pcap and pcapng captures of IEC 61850 traffic offline: MMS associations, every confirmed service with its status and latency, reports, GOOSE and Sampled Values streams, and what the capture lost. Library and mmstracectl.

go get github.com/otfabric/go-mms-trace

go-iec61850-model

The IEC 61850 information model without a transport: an edition-aware catalog of logical nodes, data objects, CDCs and data attributes from every official NSD release, with reference validation, type resolution and semantic mapping.

go get github.com/otfabric/go-iec61850-model
  • IEC 61850 model
GitHub

go-cotp

COTP TP0 transport service over RFC 1006, plus a full X.224 TPDU codec.

go get github.com/otfabric/go-cotp

go-tpkt

TPKT framing for RFC 1006 and RFC 2126 transport profiles.

go get github.com/otfabric/go-tpkt

iec61850-interop

IEC 61850 reference stacks as containers: libiec61850, IEC61850bean, dscsystems/go-iec61850, iec61850-rust and cB-Sigma, for MMS, IED services, GOOSE and Sampled Values. Formerly mms-interop.

IEC 61850 Explorer

Connect to an IEC 61850 IED, open its SCL file or a packet capture of the station bus, and see the model, the values with quality and time, and what happened on the wire. Read-only by default; controls and writes only in a granted, audited Commission mode.