Skip to main content

IEC 61850 MMS Driver

Overview

IEC 61850 MMS (Manufacturing Message Specification) — the international standard for automation in power plants, substations, ESS, and wind farms. Runs on the full ISO stack (TPKT → COTP → ISO Session → ISO Presentation → ACSE → MMS). Uses an in-house Java ASN.1/BER implementation (no external dependencies).

ItemValue
opc_typeIEC61850
Implementation classplantpulse.driver.protocol.iec61850.IEC61850Driver
LibraryIn-house Java implementation (no external dependencies, ASN.1 BER written in-house)
InheritanceBaseProtocolDriver
readOK (ReadRequest → AccessResult(MmsValue), polling)
writeOK (isWriteSupported() = true)
SecurityNone (IEC 62351 not implemented)
Default port102 (TCP)
Report (BRCB/URCB) support

In addition to polling reads, for each RCB specified in report-control-blocks the driver MMS-writes RptEna=true (plus the optional GI=true) on every connection, automatically restoring the report subscription. InformationReport (unsolicited push) messages are handled by the lastReportByVariable cache, and reads serve only cache entries fresher than the TTL (report-cache-ttl-ms) — on expiry it falls back to polling.


Class Structure (top-down)

TCP
└ ISO TPKT (RFC 1006) — Tpkt.java
└ ISO COTP (Class 0) — Cotp.java
└ ISO Session — IsoSession.java
└ ISO Presentation — IsoPresentation.java
└ ACSE — Acse.java
└ MMS (ASN.1 BER) — MmsPdu.java + Asn1.java + MmsAddress.java

Connection sequence (connect()): COTP CR → CC → Session CONNECT (encapsulating Presentation CP / ACSE AARQ / MMS Initiate-Request) → AARE → decode and validate MMS Initiate-Response. Constant DEFAULT_TPDU_SIZE = 0x0B (2048 bytes, as recommended by IEC 61850). Only a single session is used — transact() serializes transactions with synchronized and validates the response invokeID (mismatch = stale reject + socket invalidation).


OPC Registration Options

KeyDefaultDescription
opc_agent_ip / opc_agent_port102 if port is 0IED IP / port
options.connect-timeout5000 msTCP connect timeout
options.read-timeout5000 msread SO timeout
options.enable-information-reportfalseWhether BRCB/URCB reporting is enabled
options.report-control-blocks(none)Comma-separated list of RCB references — e.g. LD0/LLN0$BR$brcb01 (dot notation allowed)
options.report-gitruePerforms a general interrogation (re-receive all current values) by writing GI=true immediately after RCB activation
options.report-cache-ttl-ms30000 msFreshness TTL for the report cache — falls back to polling on expiry. <=0 disables expiry

Tag plc_address Format

MmsAddress accepts both LD/LN.DO.DA[$FC] notation and wire notation (LD/LN$FC$DO$DA). A slash (/) separates domain and item; a dot (.) is replaced with $ during wire conversion.

NotationMeaning
IED1Server/MMXU1.MX.A.phsADomain IED1Server / Item MMXU1$MX$A$phsA
IED1Server/MMXU1$MX$A$phsASame in wire notation
LD1/LLN0.Mod.stValLD LD1, LN LLN0, DO Mod, DA stVal

The FC (Functional Constraint) is either stated explicitly with $FC or written by including its standard position ($MX / $ST, etc.).


Read / Write

  • read: buildReadRequesttransact() (synchronized) → parseReadResponse → returns AccessResult (MmsValue) as a string. An InformationReport arriving interleaved while awaiting a response is cached and the wait continues. Three consecutive read failures (READ_FAIL_STREAK_LIMIT) drop connected — triggering edge recovery (PLCRecovery).
  • write: isWriteSupported() = true. data_type → MmsValue mapping:
data_type aliasMmsValue
boolean / boolbool
integer / int / long / short / byteinteger (parsed as long)
unsigned / uint / ulongunsigned
float / double / real / floating-pointfloating
octet-string / octet / bytesoctet
visible-string / string / "" / varcharvisible
mms-string / utf8mmsString
Othersvisible (fallback)

data-access-error codes are exposed as WriteResponse.errorCode.


Unsupported Areas

  • GOOSE / Sampled Values (multicast) — requires a separate raw-Ethernet stack.
  • SCL (.icd / .scd) parsing — no automatic data model discovery; entries must be made manually by the user.
  • IEC 62351-3/-6 — no TLS / authentication / integrity protection.
Fixture-level maturity

The ASN.1 BER utilities in this implementation are spec-accurate, but full wire-level interoperability with real IEDs is scheduled for a later phase. Thorough validation is recommended before production use.


References

  • IEC 61850-7-2 (ACSI), -8-1 (mapping to MMS), ISO 9506 (MMS). ASN.1 BER — ITU-T X.690.
  • Code: plantpulse-edge-driver/src/plantpulse/driver/protocol/iec61850/.