nsdctl
nsdctl is the command-line tool included with go-iec61850-model. It answers integration questions from the official IEC 61850 information model embedded in it, with no download or setup, and works on NSD packages you obtained yourself. It does not talk to devices: for that, use iec61850ctl.
Install
Section titled “Install”Download a binary for Linux, macOS or Windows from the go-iec61850-model releases; each release carries a SHA-256 checksum file. With a Go toolchain:
go install github.com/otfabric/go-iec61850-model/cmd/nsdctl@latestnsdctl versionnsdctl completion bash|zsh|fish|powershell prints a shell completion script.
What a logical node holds
Section titled “What a logical node holds”nsdctl model show MMXU # every data object, inherited ones included, with CDC and presencensdctl model measurements MMXU # what each measurement means, per phase, with the expected unitnsdctl model leaves MMXU.TotW --fc MXThe last command lists the attributes a client reads for total active power (output from the go-iec61850-model use cases):
PATH TYPE KIND FCMMXU.TotW.instMag.i INT32 BASIC MXMMXU.TotW.instMag.f FLOAT32 BASIC MXMMXU.TotW.mag.i INT32 BASIC MXMMXU.TotW.mag.f FLOAT32 BASIC MXMMXU.TotW.range RangeKind ENUMERATED MXMMXU.TotW.q Quality BASIC MXMMXU.TotW.t Timestamp BASIC MXWhat a reference means
Section titled “What a reference means”nsdctl model describe 'LD0/MMXU1.PhV.phsA.cVal.mag.f[MX]'nsdctl model show 'LD0/MMXU1.PhV.phsA.cVal.mag.f[MX]'describe prints the semantic descriptor (voltage, phase A, line to ground, magnitude, expected in V) with the rule it came from. show resolves the reference step by step, with the type, functional constraint, presence and declaring namespace of every element. A reference the model does not define fails with exit code 1 and names the element that is wrong. Quote references in shells that glob brackets, such as zsh.
Decode raw values
Section titled “Decode raw values”nsdctl model show SIUnitKind # 38 is Wnsdctl model show MultiplierKind # 3 is knsdctl model show BehaviourModeKind # 5 is offTwo namespaces, one name
Section titled “Two namespaces, one name”nsdctl -p extended model show DBAT --ns 90-9nsdctl catalog overlaps --left IEC_61850-7-420 --right IEC_TR_61850-90-9Without --ns, a name that two namespaces of the profile define fails as ambiguous. catalog overlaps classifies every shared name as identical, a compatible extension or conflicting.
Work with NSD packages
Section titled “Work with NSD packages”nsdctl sources fetch # official packages into .nsd-cache/, digests verifiednsdctl sources check --packages .nsd-cache # coverage of the tracked packagesnsdctl validate .nsd-cachensdctl -s .nsd-cache model show MMXUnsdctl diff --exit-code ./old/ ./new/nsdctl -s .nsd-cache generate go -o .generated/go --package iec61850namesWithout --source (-s), the model and catalog commands use the embedded catalog; -p selects a named profile (default, extended) or a namespace release. Apart from sources fetch, nsdctl never downloads anything. Output generated from NSD packages stays local unless the lock file permits publishing it.
Output and exit codes
Section titled “Output and exit codes”Every command prints text, or JSON with --json, so the model can feed scripts, tag lists and UIs directly.
| Code | Meaning |
|---|---|
| 0 | OK |
| 1 | Usage error, or a name or reference the model does not define |
| 2 | Source error |
| 3 | Validation error |
| 4 | Differences found (diff --exit-code) |
| 5 | Refused by the licence policy |
The command reference and the use cases in the repository have every command with real output.