Skip to main content

Master object dictionary (Master OD)

A master object dictionary that follows the ETG.1510 standard. It provides master identity information plus slave configuration, status and diagnostic data, and lets external diagnostic tools and HMI reach it over the standard SDO interface.

Access it through master.master_od.​

ETG.1510 standard

The master object dictionary is implemented according to the ETG.1510 specification. Used together with the mailbox gateway, it gives remote diagnostic tools standard access to the master.

Object index overview​

IndexCategoryNameSubindexesRead/writeDescription
0x1000Device identityDevice Type0Read-only0x00001389 (EtherCAT master)
0x1008Device identityManufacturer Device Name0Read-only"Darra EtherCAT Master"
0x1009Device identityManufacturer Hardware Version0Read-onlyProcess bitness: a 64-bit process returns "x64", a 32-bit process returns "x86"
0x100ADevice identityManufacturer Software Version0Read-onlySDK version (major.minor.build)
0x1018Device identityIdentity Object4Read-onlyMaster identity information
0x8nnnSlave configurationConfiguration Data40Read-onlyConfiguration data of slave n
0x9nnnSlave informationInformation Data32Read-onlyDetected information of slave n
0xAnnnSlave diagnosticsDiagnosis Data19Read-onlyDiagnostic data of slave n
0xF002ScanDetect Modules Command3Read-onlySlave scan status
0xF120Master diagnosticsMaster Diag Data16Read-onlyMaster diagnostic data
0xF200Diagnostic controlDiag Interface Control16Read/writeDiagnostic interface control
note

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

Known difference (to be unified in a later version)

0x1009 has two read paths and two return values: master.master_od.read_object returns "x64" / "x86"; the mailbox gateway path currently returns "1.0". This is recorded as implemented; a later version will unify it to the process bitness.

0x1018 — Master identity (Identity Object)​

SubindexCategoryNameTypeValueRead/writeDescription
0IdentityNumber of Entriesint4Read-onlyFixed
1IdentityVendor IDint0x00001164Read-onlyAssigned by ETG, fixed value
2IdentityProduct Codeint0x00000001Read-onlyFixed value
3IdentityRevision NumberintAutomaticRead-onlyDerived automatically from the underlying library version (high word = major version, low word = minor version)
4IdentitySerial NumberintAutomatic, incrementingRead-onlyEach instance is assigned 0, 1, 2... automatically, so multiple master instances can be told apart

0x8nnn — Slave configuration data​

Each slave has one 0x8nnn object (nnn = slave index) holding the static information configured in the ENI.

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 40
1AddressFixed Station AddressintRead-onlyConfigured address ConfigAddr (slave.config_addr), not the 1-based slave index; a failed read returns None
2IdentificationTypestrRead-onlyDevice type string (slave.drive_name, ASCII; non-ASCII characters are replaced with ? under the ASCII convention); a failed read returns None
3IdentificationNamestrRead-onlySlave group name (slave.name, the EEPROM group_name; ASCII; non-ASCII characters follow the same replacement convention as :2); a failed read returns None
4IdentificationDevice TypeintRead-onlyFixed 0 (same convention as the SDKs in other languages: this field has no data source and is always 0) — this is a well-founded definite value, not "unknown"
5IdentificationVendor IDintRead-onlyVendor ID
6IdentificationProduct CodeintRead-onlyProduct code
7IdentificationRevision NumberintRead-onlyRevision number
8IdentificationSerial NumberintRead-onlySerial number
33MailboxMailbox Out SizeintRead-onlySM0 mailbox output size (slave.mbx_length, u16); a failed read returns None
34MailboxMailbox In SizeintRead-onlySM1 mailbox input size (slave.mbx_read_length, u16); a failed read returns None
35LinkLink StatusintRead-onlyETG.1510 0x8nnn:35 (1 byte). bit0 = slave lost (the criterion is the live verdict for the current cycle; the latched lost-slave flag is not read); bit(4+p) = port p currently has a link (p=0..3); the remaining bits are always 0. This byte has no unknown encodings: all high bits 0 may simply mean this slave's DLSTAT has never been sampled, so a 0 alone must not be taken to assert "all four ports are down". When the read fails, read_object returns None (subindex unavailable) rather than passing off 0.
36LinkLink PresetintRead-onlyETG.1510 0x8nnn:36 (1 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 popcount of slave.active_ports in the current cycle (200 ms DLSTAT refresh), the same sample as :35; it is not the link count from configuration time. 0 = definitively no port is expected to have a link (also returned as 0 when the input is unknown). When the underlying layer returns non-0, read_object returns None rather than passing off 0.
37LinkFlagsintRead-onlyFixed 0 (1 byte; same convention as the SDKs in other languages; Bit3 reserved) — a definite value, not "unknown"
38LinkPort PhysicsintRead-onlyPort physical type (slave.physical_type, u16); a failed read returns None
39MailboxMailbox ProtocolsintRead-onlyBit mask of the supported mailbox protocols (slave.mbx_proto, u16; CoE=0x04, FoE=0x08 and so on); a failed read returns None
40DiagnosticsDiag History SupportedintRead-onlyWhether 0x10F3 is reachable, decided in three tiers: (a) no CoE mailbox (mbx_proto does not contain 0x04, or the SM0 length is 0) ⇒ 0; (b) the OD list is loaded ⇒ 1 if it contains 0x10F3, otherwise 0; (c) not loaded ⇒ None (the diagnostic read path does not trigger a scan)
Implementation coverage

read_object currently implements subindexes 0, 1, 2, 3, 4, 5, 6, 7, 8, 33, 34, 35, 36, 37, 38, 39 and 40 for 0x8nnn; the rest (9–32, 41 and above) return None.

0x9nnn — Slave detection information​

Each slave has one 0x9nnn object holding the actual information detected at runtime.

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 32
1AddressStation AddressintRead-onlyActual configured address ConfigAddr (slave.config_addr), not the 1-based slave index; a failed read returns None
5IdentificationVendor IDintRead-onlyDetected vendor ID
6IdentificationProduct CodeintRead-onlyDetected product code
7IdentificationRevision NumberintRead-onlyDetected revision number
8IdentificationSerial NumberintRead-onlyDetected serial number
32LinkDL StatusintReservedDL Status register (ESC 0x0110-0x0111)
Implementation coverage

read_object currently implements only subindexes 0, 1 and 5–8 for 0x9nnn; subindex 32 is an ETG.1510 layout placeholder and reads return None.

0xAnnn — Slave diagnostic data​

Each slave has one 0xAnnn object holding diagnostic data. Reads all go through the underlying ETG.1510 entry point that returns the real value (Etg1510_ReadObject, a blocking register read): subindexes 1–5 and 10–13 are read from it; subindexes 6–9 come from one underlying read of the fixed addresses of the 4 ports; subindex 18 is taken from slave.coe.last_sdo_error; subindexes 14–17 and 19 have no true-value source and return None. Convention: unavailable = None; never pass off 0 as a definite value; 0 is reported only where a true value of 0 really exists (on this page :18 is such a case when no SDO abort has ever occurred).

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 19
1StatusAL StatusintRead-onlyAL Status from ESC 0x0130 (underlying ETG.1510 blocking read); returns None when it cannot be read, never passing off 0 as "a live slave in INIT with no error"
2ControlAL ControlintRead/writeRead = current value of ESC 0x0120 (underlying blocking read; returns None when it cannot be read); write = write_object writes ESC 0x0120, and the data must be 2 bytes (one of the only writable subindexes)
3StatusLast AL Status CodeintRead-onlyMost recent AL error code from ESC 0x0134 (underlying blocking read); returns None when it cannot be read
4LinkLink Conn. StatusintRead-onlyLink Conn. Status (the DL Status bit field parsed into a two-bit connection state per port), not the port this slave is attached to; returns None when it cannot be read
5LinkLink ControlintRead-onlyLink control from ESC 0x0101 (underlying blocking read); returns None when it cannot be read
6LinkFixed Addr Conn. Port 0intRead-onlyOne underlying read of the fixed addresses of the four ports P0..P3 delivers this entry as P0; a failed read returns None. 0 = this port reports no connected slave, which is not the same as definitively nothing being connected (it also returns 0 when the parent is unknown). To find which port of the parent this slave is attached to, use slave.parent_port
7LinkFixed Addr Conn. Port 1intRead-onlyOne underlying read of the fixed addresses of the four ports P0..P3 delivers this entry as P1; a failed read returns None. 0 = this port reports no connected slave, which is not the same as definitively nothing being connected (it also returns 0 when the child's parent_port is unknown)
8LinkFixed Addr Conn. Port 2intRead-onlyOne underlying read of the fixed addresses of the four ports P0..P3 delivers this entry as P2; a failed read returns None. 0 = this port reports no connected slave, which is not the same as definitively nothing being connected (it also returns 0 when the child's parent_port is unknown)
9LinkFixed Addr Conn. Port 3intRead-onlyOne underlying read of the fixed addresses of the four ports P0..P3 delivers this entry as P3; a failed read returns None. 0 = this port reports no connected slave, which is not the same as definitively nothing being connected (it also returns 0 when the child's parent_port is unknown)
10LinkFrame Error Port 0intRead-onlyFrame error count of port 0 (ESC 0x0300+2×p, underlying blocking read); returns None when it cannot be read
11LinkFrame Error Port 1intRead-onlyFrame error count of port 1, same as :10; returns None when it cannot be read
12LinkFrame Error Port 2intRead-onlyFrame error count of port 2, same as :10; returns None when it cannot be read
13LinkFrame Error Port 3intRead-onlyFrame error count of port 3, same as :10; returns None when it cannot be read
14CounterCyclic WC Error CounterintUnavailableUnavailable: there is no per-slave source for the real value of a cumulative cyclic WKC error counter; the read returns None
15CounterSlave Not Present CounterintUnavailableUnavailable: there is no per-slave source for the real value of a cumulative slave-absence counter; the read returns None
16CounterAbnormal State Change CounterintUnavailableUnavailable: there is no per-slave source for the real value of a cumulative abnormal state change counter; the read returns None
17LinkDisable Auto Link ControlintUnavailableUnavailable: neither the underlying layer nor the CoE side has a mirrored source for this per-slave flag; the read returns None (it does not pass off False)
18ProtocolLast CoE/SoE Protocol ErrorintRead-onlyMost recent CoE/SoE protocol error code (taken live from slave.coe.last_sdo_error); 0 when no SDO abort has ever occurred (a real value)
19DiagnosticsNew Diag MessagesintUnavailableUnavailable: it would require really reading 0x10F3:4 from the slave, and there is no per-slave source for the real value of the flag; the read returns None (it does not pass off False)

0xF002 — Scan command​

Safety guard

The 0xF002 scan command rejects external writes. 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. More functions will come in a future update.

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 3
1ScanScan Command RequestintRead-onlyScan command request (external writes are rejected)
2ScanScan Command StatusintRead-only1 = finished without error, 3 = finished with error, 255 = in progress
3ScanScan Command ResponsebytesRead-onlyState + error code + detected slave count
Implementation coverage

On the Python side the slave scan does not go through this object; in the current implementation subindex 2 is always 1 (finished without error) and the detected slave count in subindex 3 is always 0.

0xF120 — Master diagnostic data​

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 16
1StatisticsCyclic Lost FramesintRead-onlyCumulative count of lost cyclic frames (a real count, not scaled into a percentage)
2StatisticsAcyclic Lost FramesintRead-onlyCumulative count of lost acyclic frames (underlying ETG.1510 blocking read); returns None when it cannot be read, never passing off 0 as "no lost frames"
3StatisticsCyclic Frames/SecondintRead-onlyCyclic frames per second (taken from the underlying bus cycle; returns 0 when the real cycle cannot be obtained)
4StatisticsAcyclic Frames/SecondintRead-onlyAcyclic frames per second (underlying ETG.1510 blocking read); returns None when it cannot be read
16StatusMaster StateintRead-onlyCurrent EtherCAT state of the master

0xF200 — Diagnostic interface control​

SubindexCategoryNameTypeRead/writeDescription
0StructureNumber of EntriesintRead-onlyFixed at 16
16ControlReset Diag InfointWritableWriting 1 resets the last protocol error cache of 0xAnnn:18 (triggered on a rising edge)

Methods​

read_object()​

def read_object(self, index: int, subindex: int) -> Optional[bytes]

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

Parameters:

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

Returns:

  • Optional[bytes] — the raw data read; an unknown object or a subindex that is not available yet returns None (unavailable ≠ 0; do not fold it into 0 as a definite value)

Example:

import struct

vid = master.master_od.read_object(0x8001, 5)
if vid is not None:
vendor_id = struct.unpack('<I', vid)[0]
print(f"厂商ID: 0x{vendor_id:08X}") # VendorID: 0x{vendor_id:08X}

write_object()​

def write_object(self, index: int, subindex: int, data: bytes) -> bool

Writes to the master object dictionary. Only 0xF200:16 (Reset Diag Info) and 0xAnnn:2 (AL Control, written to ESC 0x0120, must be 2 bytes) are writable subindexes; 0xF002 is read-only for safety, and writes to every other object and subindex return False (see the Read/write column of the object tables above).

Parameters:

  • index (int) — object index
  • subindex (int) — subindex
  • data (bytes) — the data to write

Returns:

  • bool — True on success

get_object_name()​

def get_object_name(self, index: int) -> str

Gets the name of an object.

Parameters:

  • index (int) — object index

Returns:

  • str — the object name; an unknown index returns "Unknown"

get_subindex_count()​

def get_subindex_count(self, index: int) -> int

Gets the subindex count of an object.

Parameters:

  • index (int) — object index

Returns:

  • int — the subindex count (an unknown index returns 0)

get_supported_object_indices()​

def get_supported_object_indices(self) -> List[int]

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

Returns:

  • List[int] — the list of supported indexes

Reading and writing the master object dictionary​

Reads and writes both go through master.master_od:

# Read the master object dictionary
data = master.master_od.read_object(0x1018, 1)

# Write to the master object dictionary (only some objects are writable)
ok = master.master_od.write_object(0xF200, 16, bytes([1]))

Complete example​

od = master.master_od

def hex_or_none(data):
return "None" if data is None else f"0x{int.from_bytes(data, 'little'):X}"

for i in range(1, master.slave_count + 1):
cfg_idx = 0x8000 | i
diag_idx = 0xA000 | i

addr = od.read_object(cfg_idx, 1) # ConfigAddr
name = od.read_object(cfg_idx, 3) # device name (ASCII)
link_status = od.read_object(cfg_idx, 35) # ETG.1510 Link Status
link_preset = od.read_object(cfg_idx, 36) # ETG.1510 Link Preset
sdo_err = od.read_object(diag_idx, 18) # most recent SDO Abort Code

# None = this subindex is unavailable; do not collapse it to 0 and treat it as a "known value"
print(f"从站{i} [{name.decode('ascii') if name else 'None'}]: " # Slave{i} [{name.decode('ascii') if name else 'None'}]:
f"ConfigAddr={hex_or_none(addr)}, "
f"LinkStatus={hex_or_none(link_status)}, "
f"LinkPreset={hex_or_none(link_preset)}, "
f"SDOLastErr={hex_or_none(sdo_err)}")

# Reset the diagnostic cache (0xF200:16, rising-edge triggered)
od.write_object(0xF200, 16, bytes([1]))