Skip to main content

Master object dictionary (Master OD)

A master object dictionary that follows ETG.1510, exposing master identity plus slave configuration, state and diagnostic data to external diagnostic tools and HMI over the standard SDO interface.

Access through master.masterOD().​

ETG.1510 standard

The master object dictionary follows the ETG.1510 specification and uses the standard CoE index conventions. Unlike a slave CoE object dictionary, it holds the diagnostic objects the master exposes for itself. Together with the mailbox gateway, it enables standard access to the master for remote diagnostic tools.

Object index overview​

CategoryIndexNameSubindexesRead/writeDescription
Identity0x1000Device Type0Read-only0x00001389 (EtherCAT master)
Identity0x1008Manufacturer Device Name0Read-only"Darra EtherCAT Master"
Identity0x1009Manufacturer Hardware Version0Read-onlyProcess bitness: a 64-bit process returns "x64", a 32-bit process returns "x86" (through the ETG.1510 read entry point)
Identity0x100AManufacturer Software Version0Read-onlyRuntime library version number (major.minor.revision[.build])
Identity0x1018Identity Object4Read-onlyMaster identity information (see the subindex table below)
Configuration0x8nnnConfiguration Data40Read-onlyConfiguration data of slave n (address, type, name, identity, mailbox sizes, link status/preset)
Detection0x9nnnInformation Data32Read-onlyFixed information of slave n (configuration address, vendor/product/revision/serial number, DL status)
Diagnostics0xAnnnDiagnosis Data19Read/writeDiagnostic data of slave n (AL Status, link, port connection addresses, port error counters and so on; only :2 is writable)
Detection0xF002Detect Modules Command3Read-onlyScan command request / status / response (external writes are rejected)
Diagnostics0xF120Master Diag Data16Read-onlyMaster diagnostic data (lost-frame count, frame rate, master state)
Control0xF200Diag Interface Control16Read/writeDiagnostic interface control (subindex 16 resets the diagnostic counters)
note

nnn = slave index (1-based); the indexes are generated dynamically from master.slaveCount(). With 3 slaves, for example, 0x8001 ~ 0x8003, 0x9001 ~ 0x9003 and 0xA001 ~ 0xA003 are all accessible.

Variable objects have no subindexes

0x1000 / 0x1008 / 0x1009 / 0x100A are variable objects; take their value directly with readObject(index, (byte) 0). Do not use getSubindexCount to determine their subindex count.

Known difference

0x1009 has two read paths and two return values: master.masterOD().readObject goes through the ETG.1510 read entry point and returns "x64" / "x86"; the mailbox gateway path currently returns "1.0". Both paths answer truthfully according to their own current state.

0x1018 — Master identity (Identity Object)​

SubindexNameTypeValueRead/writeDescription
0Number of Entriesbyte4Read-onlyFixed
1Vendor IDuint0x00001164Read-onlyAssigned by ETG, fixed value
2Product Codeuint0x00000001Read-onlyFixed value
3Revision NumberuintAutomaticRead-onlyDerived from the runtime library version: high 16 bits = major version, low 16 bits = minor version
4Serial NumberuintAutomaticRead-onlyDerived from the runtime library version: high 16 bits = revision part, low 16 bits = build part

Revision Number and Serial Number follow the runtime library version and are not fixed constants; to get the version string, read 0x100A.

0x8nnn — Slave configuration data​

Each slave has one 0x8nnn object (nnn = slave index), with a fixed layout of 40 subindexes, the same as the other language editions.

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 40 (a conforming client reads :0 first and then decides which subindexes to read)
1Fixed Station AddressushortRead-onlyConfiguration address of this slave (slave.configAddr())
2TypestringRead-onlyDevice type string
3NamestringRead-onlyDevice name; it currently returns the same name as :2. To tell the EEPROM name apart from the SDO 0x1008 name, use slave.name() / slave.driveName()
4Device TypeuintRead-onlyAlways 0 (no Device Type value is currently provided)
5Vendor IDuintRead-onlyVendor ID (slave.vendorId(), or slave.getSlaveIdentity()[0])
6Product CodeuintRead-onlyProduct code (slave.productId())
7Revision NumberuintRead-onlyRevision number (slave.revision())
8Serial NumberuintRead-onlySerial number (slave.serialNumber())
33Mailbox Out SizeushortRead-onlySend mailbox length (slave.mbxLength())
34Mailbox In SizeushortRead-onlyReceive mailbox length (slave.mbxReadLength())
35Link StatusbyteRead-onlybit0 = slave-lost state (the verdict measured in the current cycle); bit(4+p) = port p currently has a link (p = 0..3); the remaining bits are always 0. This byte has no unknown encoding: all high bits being 0 can also mean this slave's DL status was never sampled, so a 0 alone must not be taken to assert "all four ports are down". Returns null when unreadable.
36Link PresetbyteRead-onlyLow nibble = mask of the ports expected to have a link (bit0..3 = P0..P3), high nibble = the same mask shifted left by 4; N linked ports → 0x11 / 0x33 / 0x77 / 0xFF. The input is the number of ports with a link measured in the current cycle, using the same link bits as :35; it is not a configuration-time topology snapshot. 0 = definitively no expected port (also returns 0 when the input is unknown). Returns null when unreadable.
37FlagsbyteRead-onlyAlways 0 (Bit3 reserved)
38Port PhysicsushortRead-onlyTopology physical type (slave.physicalType(), 0-4)
39Mailbox ProtocolsushortRead-onlySII mbx_proto capability bitmap (slave.mbxProtoRaw())
Actual Java implementation
  • Both entry points agree: readObject(0x8nnn, 0) and getSubindexCount(0x8nnn) both answer 40. The subindexes that are actually readable are the ones listed below; reading any other subindex returns null — read :0 first and then decide which subindexes to read.
  • Implemented subindexes: :0, :1..:8, :33..:39. Here :1 = Fixed Station Address, :2 = Type, :3 = Name (not the earlier C# layout that put the identity quadruple in :1..:4); the identity quadruple is in :5..:8 (Vendor ID / Product Code / Revision Number / Serial Number); :37 is always 0. The slave group number is not in this object — use slave.group().
  • The remaining subindexes (:9..:32, :40) have no usable data source, and readObject returns null; :35 / :36 likewise return null when unreadable — never use 0 to pass off a conclusion, because 0 is a definite value.
  • String subindexes (:2, :3) are returned as UTF-8 bytes without a trailing NUL.
  • Numeric subindexes are always little-endian: :1/:33/:34 are 2 bytes, :4..:8/:38/:39 are 4 bytes (the values of :38/:39 fit in 16 bits).

0x9nnn — Slave detection information​

Each slave has one 0x9nnn object holding the fixed information read back at runtime plus link status.

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 32
1Fixed Station AddressushortRead-onlyConfiguration address of this slave (slave.configAddr())
5Vendor IDuintRead-onlyVendor ID
6Product CodeuintRead-onlyProduct code
7Revision NumberuintRead-onlyRevision number
8Serial NumberuintRead-onlySerial number
32DL StatusushortRead-onlyRaw value of the slave DL status register (0x0110)

The remaining subindexes (:2..:4, :9..:31) are not implemented at present and return null when read.

0xAnnn — Slave diagnostic data​

Each slave has one 0xAnnn object holding live diagnostic data. It is updated automatically on every read.

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 19
1AL StatusushortRead-onlyCurrent AL status word (status byte + Error bit + AL status code), taken from ESC 0x0130
2AL ControlushortRead/writeAL control word (ESC 0x0120). Reading returns 2 bytes; a write must be exactly 2 bytes, a wrong length returns false, and the write is propagated to the slave
3Last AL Status CodeushortRead-onlyMost recent AL error code (ESC 0x0134)
4Link Conn. StatusbyteRead-onlyPer-port link bits: bit p = communication established on port p, bit(4+p) = port p currently has a link (p = 0..3). This is not "which port of the parent this slave is attached to"; for that use slave.parentPort()
5Link ControlbyteRead-onlyRaw value of the link control register (ESC 0x0101)
6Fixed Addr Conn. Port 0ushortRead-onlyFixed address of the upstream parent slave (the raw configadr value). 0 = this port did not report a connected slave and does not mean none is connected
7Fixed Addr Conn. Port 1ushortRead-onlyFixed address of the downstream child slave attached to P1 of this slave; same interpretation as :6. 0 = no connected slave reported, and it does not mean none is connected
8Fixed Addr Conn. Port 2ushortRead-onlyFixed address of the downstream child slave attached to P2 of this slave; same interpretation as :6. 0 = no connected slave reported, and it does not mean none is connected
9Fixed Addr Conn. Port 3ushortRead-onlyFixed address of the downstream child slave attached to P3 of this slave; same interpretation as :6. 0 = no connected slave reported, and it does not mean none is connected
10Frame Error Port 0intRead-onlyPort 0 frame error count (8-bit counter, returned as 4 bytes)
11Frame Error Port 1intRead-onlyPort 1 frame error count (8-bit counter, returned as 4 bytes)
12Frame Error Port 2intRead-onlyPort 2 frame error count (8-bit counter, returned as 4 bytes)
13Frame Error Port 3intRead-onlyPort 3 frame error count (8-bit counter, returned as 4 bytes)
14Cyclic WC Error CounterintUnavailableNo usable data source; the read returns null
15Slave Not Present CounterintUnavailableNo usable data source; the read returns null
16Abnormal State Change CounterintUnavailableNo usable data source; the read returns null
17Disable Auto Link ControlbyteUnavailableNo usable data source; the read returns null
18Last CoE/SoE Protocol ErrorintUnavailableNo usable data source; the read returns null; for that quantity use lastCoESoEProtocolError(int)
19New Diag MessagesbyteUnavailableNo usable data source; the read returns null
Readable subindexes of 0xAnnn

The readable ones are :1..:13; :14..:19 have no usable data source and always return null when read — another field is never passed off in their place.

Only :2 (AL Control) is available for writing, and the length must be 2 bytes; writeObject on any other subindex returns false and logs.

Note that :4 (Link Conn. Status) holds per-port link bits; it is not "which port of the parent this slave is attached to" — the only answer to that is slave.parentPort(). Only slave.parentPort() together with :6..:9 reconstructs the topology.

0xF002 — Scan command​

Safety guard

0xF002 rejects external writes (writeObject always returns false). Running a scan while the master is operating can lose the configuration and upset devices, so this object is read-only. A slave scan runs only during master initialization, driven by internal logic. More functionality will come in a future update.

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 3
1Scan Command RequestushortRead-onlyScan command request, always 0
2Scan Command StatusbyteRead-onlyScan command status
3Scan Command Responsebyte[6]Read-onlyFirst 4 bytes = status and error code, last 2 bytes = current slave count (ushort, little-endian)

0xF120 — Master diagnostic data​

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 16
1Cyclic Lost FramesuintRead-onlyCyclic lost-frame count
2Acyclic Lost FramesuintRead-onlyAcyclic lost-frame count
3Cyclic Frames/SeconduintRead-onlyCyclic frames per second
4Acyclic Frames/SeconduintRead-onlyAcyclic frames per second
16Master StateushortRead-onlyCurrent EtherCAT state of the master (as defined by ETG.1510)

The remaining subindexes are not implemented at present and return null when read.

What the 0xF120 fields cover

0xF120 provides lost-frame counts, frame rates and the master state; for the slave count, the expected WKC and link status, read the corresponding metrics from master.diagnostics() (diagnostic tools read the ETG.1510 field semantics through the standard objects).

0xF200 — Diagnostic interface control​

SubindexNameTypeRead/writeDescription
0Number of EntriesbyteRead-onlyFixed at 16
16Reset Diag InfobyteRead/writeWrite 1 byte and take the lowest bit as the reset level; the diagnostic counters are reset only on a rising edge from 0 to 1, and writing again while the level stays 1 does not reset again. Reading returns the current level

The remaining subindexes are not implemented at present and return null when read.

Resetting is equivalent to master.diagnostics().reset(); both entry points have the same effect, so use either one.

Method overview​

CategoryMethodTypeRead/writeDescription
ReadreadObject(int index, byte subindex)byte[]Read-onlyReads raw data; an unreadable entry returns null
WritewriteObject(int index, byte subindex, byte[] data)booleanWrite-onlyWrites; only 0xAnnn:2 and 0xF200:16 are writable, everything else returns false
QuerygetObjectName(int index)StringRead-onlyObject name; an unknown index returns null
QuerygetSubindexCount(int index)byteRead-onlySubindex count of a record object
QuerygetSupportedObjectIndices()List<Integer>Read-onlyList of supported indexes
LinklinkStatus(int slaveIndex)IntegerRead-only0x8nnn:35 link status byte; returns null when unreadable
LinklinkPreset(int slaveIndex)IntegerRead-only0x8nnn:36 link preset byte; returns null when unreadable
LinkfixedAddrConnPorts(int slaveIndex)int[]Read-onlyFixed addresses of the slaves connected to the four ports, from 0xAnnn:6..:9; returns null when unreadable
DiagnosticsalStatusExtended(int slaveIndex)IntegerRead-only0xAnnn:1 AL status word; returns null when unreadable
DiagnosticslastALStatusCode(int slaveIndex)intRead-only0xAnnn:3 most recent AL error code; returns 0 when the read fails
DiagnosticslastCoESoEProtocolError(int slaveIndex)longRead-onlyMost recent CoE/SoE protocol error code (SDO Abort Code); 0 when it has never occurred
DiagnosticscyclicWCErrorCounter(int slaveIndex)LongRead-only0xAnnn:14 WKC error count; returns null when unreadable
DiagnosticsnewDiagMessagesAvailable(int slaveIndex)BooleanRead-only0xAnnn:19 whether there are new diagnostic messages; returns null when unreadable
DiagnosticsdisableAutomaticLinkControl(int slaveIndex)BooleanRead-only0xAnnn:17 whether automatic link control is disabled; returns null when unreadable

All methods throw IllegalStateException when called after the master has been released or while it is shutting down; the methods that take a slave index (linkStatus etc., 9 in total) throw IllegalArgumentException when the slave index is out of range.

API details​

readObject(int index, byte subindex)​

public byte[] readObject(int index, byte subindex)

Reads the data at the specified index from the master object dictionary.

Parameters:

  • index (int) — object index (such as 0x1018, 0x8001, 0xA001)
  • subindex (byte) — subindex

Returns:

  • byte[] — the raw data read; unreadable entries (object / subindex does not exist, master not ready, register read failure and so on) return null. Integers are returned little-endian, strings as UTF-8 bytes without a trailing NUL

Exceptions:

  • IllegalArgumentException — index outside 0x0000-0xFFFF
  • IllegalStateException — the master has been released or is shutting down

Example:

byte[] vid = master.masterOD().readObject(0x8001, (byte) 5);  // 0x8001:5 = VendorId (4 bytes)
int vendorId = ByteBuffer.wrap(vid).order(ByteOrder.LITTLE_ENDIAN).getInt();

writeObject(int index, byte subindex, byte[] data)​

public boolean writeObject(int index, byte subindex, byte[] data)

Writes to the master object dictionary. Only 0xAnnn:2 (AL Control) and 0xF200:16 (diagnostic reset) support writing; any other object returns false and logs.

Parameters:

  • index (int) — object index
  • subindex (byte) — subindex
  • data (byte[]) — the data to write; passing null is treated as empty data

Returns:

  • boolean — true on a successful write; a read-only object / subindex, a length mismatch and a failed register write all return false

Exceptions:

  • IllegalArgumentException — index outside 0x0000-0xFFFF
  • IllegalStateException — the master has been released or is shutting down

Example:

// 0xF200:16 - write 1 to trigger one diagnostic counter reset (rising-edge semantics)
od.writeObject(0xF200, (byte) 16, new byte[] { 1 });

// 0xAnnn:2 - AL Control, must be exactly 2 bytes
od.writeObject(0xA001, (byte) 2, new byte[] { 0x00, 0x02 });

getObjectName(int index)​

public String getObjectName(int index)

Gets the name of an object (it answers only the name metadata; values and availability always go through readObject).

Parameters:

  • index (int) — object index

Returns:

  • String — the object name; an unknown index returns null. Fixed indexes return the standard name (Device Type, Manufacturer Device Name, Manufacturer Hardware Version, Manufacturer Software Version, Identity Object, Detect Modules Command, Master Diag Data, Diag Interface Control); 0x8nnn / 0x9nnn / 0xAnnn return Slave Config / Slave Info / Slave Diag plus the hexadecimal index

Exceptions:

  • IllegalStateException — the master has been released or is shutting down

getSubindexCount(int index)​

public byte getSubindexCount(int index)

Gets the subindex count of an object (equivalent to reading the first byte of readObject(index, (byte) 0)).

Only record objects are parsed

0x8nnn / 0x9nnn / 0xAnnn / 0x1018 / 0xF002 / 0xF120 / 0xF200 each answer their own entry count (40 / 32 / 19 / 4 / 3 / 16 / 16), consistent with readObject(索引, (byte) 0).

0x1000 / 0x1008 / 0x1009 / 0x100A are variable objects with no subindexes, so the value returned by getSubindexCount is meaningless for them (do not use it as a subindex count); always take their value with readObject(index, (byte) 0). An index that is not registered returns 0.

Parameters:

  • index (int) — object index

Returns:

  • byte — the subindex count; an unregistered or unreadable index returns 0

Exceptions:

  • IllegalArgumentException — index outside 0x0000-0xFFFF
  • IllegalStateException — the master has been released or is shutting down

getSupportedObjectIndices()​

public List<Integer> getSupportedObjectIndices()

Gets the list of all object indexes currently supported (the fixed indexes plus the 0x8nnn/0x9nnn/0xAnnn indexes generated dynamically from the slave count).

Returns:

  • List<Integer> — the list of supported indexes, in the order: the fixed indexes (0x1000, 0x1008, 0x1009, 0x100A, 0x1018, 0xF002, 0xF120, 0xF200) followed by 0x8nnn, 0x9nnn and 0xAnnn for each slave

Exceptions:

  • IllegalStateException — the master has been released or is shutting down

linkStatus(int slaveIndex)​

public Integer linkStatus(int slaveIndex)

Reads the 0x8nnn:35 link status byte. Bit meaning: bit0 = slave-lost state (the verdict measured in the current cycle), bit(4+p) = port p currently has a link (p = 0..3). This byte has no unknown encoding; all high bits being 0 can also mean this slave's DL status was never sampled.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Integer — the raw status byte; returns null when unreadable (it is not folded into 0)

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

linkPreset(int slaveIndex)​

public Integer linkPreset(int slaveIndex)

Reads the 0x8nnn:36 link preset byte: low nibble = mask of the ports expected to have a link (bit0..3 = P0..P3), high nibble = the same mask shifted left by 4 (N linked ports → 0x11 / 0x33 / 0x77 / 0xFF). The input is the number of ports with a link measured in the current cycle, the same link bits as linkStatus.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Integer — the raw preset byte; returns null when unreadable. 0 = definitively no expected port (also returned as 0 when the input is unknown)

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

fixedAddrConnPorts(int slaveIndex)​

public int[] fixedAddrConnPorts(int slaveIndex)

Reads the fixed addresses of the slaves connected to the four ports from 0xAnnn:6..:9.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • int[] — an array of length 4: addrs[0] = fixed address of the upstream parent, addrs[1]..addrs[3] = fixed addresses of the downstream children attached to P1..P3 of this slave. 0 = this port did not report a connected slave and it does not mean none is connected (also returned as 0 when the parent / attachment port is unknown). Returns null when unreadable

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

alStatusExtended(int slaveIndex)​

public Integer alStatusExtended(int slaveIndex)

Reads the 0xAnnn:1 AL status word (u16, containing the status byte, the Error bit and the AL status code).

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Integer — the AL status word; returns null when the read fails (it does not return 0 to pass off "no error")

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

lastALStatusCode(int slaveIndex)​

public int lastALStatusCode(int slaveIndex)

Reads the most recent AL error code from 0xAnnn:3 (ESC 0x0134).

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • int — the AL error code. The return value cannot express "unavailable", so a failed read returns 0 and logs; to tell "a genuine 0" from "read failed", call readObject(0xA000 + slaveIndex, (byte) 3) directly and check for null

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

lastCoESoEProtocolError(int slaveIndex)​

public long lastCoESoEProtocolError(int slaveIndex)

Reads the most recent CoE/SoE protocol error code of the slave (SDO Abort Code, from the same source as that slave's LastSdoError). Note that this entry point is not an object dictionary read: 0xAnnn:18 has no usable data source in the object dictionary (the read returns null); use this method for that quantity.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • long — the error code (returned as an unsigned 32-bit value); returns 0 (a genuine value) when a protocol error has never occurred

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

cyclicWCErrorCounter(int slaveIndex)​

public Long cyclicWCErrorCounter(int slaveIndex)

Reads the 0xAnnn:14 cyclic WKC error count.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Long — the counter value; this subindex currently has no usable data source, so it returns null (it does not return 0 to pass off "the count really is 0"). For WKC observation use master.diagnostics()

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

newDiagMessagesAvailable(int slaveIndex)​

public Boolean newDiagMessagesAvailable(int slaveIndex)

Reads 0xAnnn:19 and queries whether there are new diagnostic messages.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Boolean — true = there are new diagnostic messages; this subindex currently has no usable data source, so it returns null (it does not return false to pass off "no messages")

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

disableAutomaticLinkControl(int slaveIndex)​

public Boolean disableAutomaticLinkControl(int slaveIndex)

Reads 0xAnnn:17 and queries whether automatic link control is disabled.

Parameters:

  • slaveIndex (int) — slave index (1-based)

Returns:

  • Boolean — true = disabled; this subindex currently has no usable data source, so it returns null (it does not return false to pass off "not disabled")

Exceptions:

  • IllegalArgumentException — slave index out of range
  • IllegalStateException — the master has been released or is shutting down

Shortcut methods​

MasterObjectDictionary also provides read accessors for the common ETG.1510 diagnostic fields (equivalent to reading the corresponding 0xAnnn subindex; lastCoESoEProtocolError is the exception, see the previous section):

Integer alExt    = od.alStatusExtended(1);            // 0xAnnn:1  AL status word (returns null when the read fails)
int alLast = od.lastALStatusCode(1); // 0xAnnn:3 most recent AL error code; returns 0 when the read fails
long protoErr = od.lastCoESoEProtocolError(1); // Last CoE/SoE error code (not an OD entry); returns 0 if it never happened
Long wkcErr = od.cyclicWCErrorCounter(1); // 0xAnnn:14 currently has no value source, always null
Boolean hasNew = od.newDiagMessagesAvailable(1); // 0xAnnn:19 currently has no value source, always null
Boolean autoOff = od.disableAutomaticLinkControl(1); // 0xAnnn:17 currently has no value source, always null

Integer link = od.linkStatus(1); // 0x8nnn:35 link status byte
Integer preset = od.linkPreset(1); // 0x8nnn:36 link preset byte
int[] conn = od.fixedAddrConnPorts(1); // 0xAnnn:6..9 connection addresses of the four ports

Complete example​

MasterObjectDictionary od = master.masterOD();

// Iterate over the diagnostics data of all slaves
for (int i = 1; i <= master.slaveCount(); i++) {
int cfgIdx = 0x8000 | i;
int diagIdx = 0xA000 | i;

// 0x8nnn:3 = Name (device name), :2 = Type (same name)
String name = master.getSlave(i).name();

// Identity data (0x8nnn:5 = VendorId; :1 is the Fixed Station Address, not identity)
byte[] vid = od.readObject(cfgIdx, (byte) 5);
int vendorId = vid != null ? ByteBuffer.wrap(vid).order(ByteOrder.LITTLE_ENDIAN).getInt() : 0;

// Read the AL Status and the error code
byte[] alStatus = od.readObject(diagIdx, (byte) 1);
byte[] alCode = od.readObject(diagIdx, (byte) 3);

int alVal = (alStatus != null && alStatus.length >= 2)
? ByteBuffer.wrap(alStatus).order(ByteOrder.LITTLE_ENDIAN).getShort() & 0xFFFF : 0;
int codeVal = (alCode != null && alCode.length >= 2)
? ByteBuffer.wrap(alCode).order(ByteOrder.LITTLE_ENDIAN).getShort() & 0xFFFF : 0;

System.out.printf("从站%d [%s]: Vendor=0x%08X, AL=0x%04X, Code=0x%04X%n", // Slave %d [%s]: Vendor=0x%08X, AL=0x%04X, Code=0x%04X%n
i, name, vendorId, alVal, codeVal);
}

// Port frame error counter (0xAnnn:10-13, 4 bytes little-endian)
byte[] fe0 = od.readObject(diagIdx, (byte) 10);
int fe0Val = (fe0 != null && fe0.length >= 4)
? ByteBuffer.wrap(fe0).order(ByteOrder.LITTLE_ENDIAN).getInt() : -1;

// Subindices with no value source (0xAnnn:14..19): readObject returns null rather than a fake 0

// Reset the diagnostic counter: triggered by a rising edge on 0xF200:16 (write 1 byte, take the lowest bit)
od.writeObject(0xF200, (byte) 16, new byte[] { 1 });

// Equivalent diagnostics entry point
master.diagnostics().reset();

// List all supported objects
List<Integer> indices = od.getSupportedObjectIndices();
for (int idx : indices) {
String name = od.getObjectName(idx);
System.out.printf("0x%04X: %s%n", idx, name);
}

// ETG.1510 diagnostic shortcuts
Integer alStatus = od.alStatusExtended(1);
Long wkcErrors = od.cyclicWCErrorCounter(1);
Boolean hasNewDiag = od.newDiagMessagesAvailable(1);

Failures and handling​

SymptomMeaningAction
readObject returns nullThe entry is unreadable (object / subindex does not exist, master not ready, register read failure)Treat it as "unavailable"; do not treat it as 0. To tell the causes apart, see the failure records in the log
writeObject returns falseThe object is read-only, the length does not match, or the register write failedOnly 0xAnnn:2 and 0xF200:16 are writable; 0xAnnn:2 must be exactly 2 bytes
A shortcut method returns null (Boolean / Long / Integer)That subindex currently has no usable data sourceJudge with the tri-state semantics; do not substitute == false / == 0
lastALStatusCode returns 0It may be a genuine 0 or a failed readTo tell them apart, use readObject and check for null
Throws IllegalArgumentExceptionThe index is outside 0x0000-0xFFFF, or the slave index is out of rangeCheck the arguments
Throws IllegalStateExceptionThe master has been released or is shutting downDo not hold an object reference and use it across master lifecycles

Failure paths always log (including the failing index / subindex and the reason) and are never swallowed silently; for logging usage see Logging.