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.master_od().​

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 that the master exposes for itself. Together with the mailbox gateway, it gives remote diagnostic tools standard access to the master.

Object index overview​

CategoryIndexNameSubindexesRead/writeDescription
Basic0x1000Device Type0Read-only0x00001389 (EtherCAT Master)
Basic0x1008Device Name0Read-only"Darra EtherCAT Master"
Basic0x1009Hardware Version0Read-only"1.0"
Basic0x100ASoftware Version0Read-onlySDK version
Identity0x1018Identity Object4Read-onlyMaster identity information (see the subindex table below)
Slave0x8nnnConfiguration Data40Read-onlyConfiguration data of slave n
Slave0x9nnnInformation Data32Read-onlyDetected information of slave n
Slave0xAnnnDiagnosis Data19Partially writableDiagnostic data of slave n
Scan0xF002Detect Modules3Read-onlySlave scan status
Diagnostics0xF120Master Diag Data16Read-onlyMaster diagnostic data
Diagnostics0xF200Diag Interface Control16WritableDiagnostic 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.

Subindexes actually implemented on the Rust side

The object model follows ETG.1510; the Rust MasterObjectDictionary currently implements only the subindexes listed below. Reading any other subindex returns an SDO abort (read_object() returns None; it never returns all 0s to pass off as success):

ObjectImplemented subindexes
0x8nnn0 (Count=40), 1 Vendor ID, 2 Product Code, 3 Revision Number, 4 Serial Number
0x9nnn0 (Count=32), 1 AL status (u8), 2 AL status code (u16)
0xAnnn0 (Count=19), 1 AL status (u8), 2 AL status code (u16; writing this subindex = writing the slave's AL Control register 0x0120), 3 link quality (u16)
0xF0020, 1, 2 (number of slaves found by the scan, u16), 3
0xF1200 (Count=16), 1-4 (lost-frame counters / frame rate), 5 Master State
0xF2000 (Count=16), 16 (raw level of the reset request)

35 / 36 return MasterObjectDictionary in None (SDO abort); the current Rust public API provides no read entry point for these two.

0x1018 — Master identity (Identity Object)​

SubindexNameTypeRead/writeValueDescription
0Number of Entriesu8Read-only4Fixed
1Vendor IDu32Read-only0x00001164Assigned by ETG, fixed value
2Product Codeu32Read-only0x00000001Fixed value
3Revision Numberu32Read-onlyAutomaticDerived automatically from the runtime version
4Serial Numberu32Read-onlyAutomatic, incrementingEach instance is assigned 0, 1, 2... automatically

0x8nnn — Slave configuration data (ETG.1510 model)​

Each slave has one 0x8nnn object holding the static information configured in the ENI. The table below is the ETG.1510 object model; for the subindexes the Rust implementation actually provides, see the caution note above.

SubindexNameTypeRead/writeDescription
0Number of Entriesu8Read-onlyFixed at 40
1Fixed Station Addressu16Read-onlyConfigured address (ConfigAddr)
2TypeStringRead-onlyDevice type string
3NameStringRead-onlyDevice name
4Device Typeu32Read-onlyDevice type code
5Vendor IDu32Read-onlyVendor ID
6Product Codeu32Read-onlyProduct code
7Revision Numberu32Read-onlyRevision number
8Serial Numberu32Read-onlySerial number
33Mailbox Out Sizeu16Read-onlySM0 mailbox output size
34Mailbox In Sizeu16Read-onlySM1 mailbox input size
35Link Statusu8Read-onlyPort link status (ETG.1510 0x8nnn:35, 1 byte): bit0 = slave lost (judged from the current-cycle liveness verdict, not a latched historical flag); 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 link status was never sampled", so 0 alone must not be taken as proof that all four ports are down
36Link Presetu8Read-onlyPort mask expected to have a link (ETG.1510 0x8nnn:36, 1 byte): low nibble = bit0..3 port mask, high nibble = the same mask shifted left by 4; N ports with links → 0x11 / 0x33 / 0x77 / 0xFF; 0 = no port is expected for certain (also returns 0 when the input is unknown). The value follows the currently measured number of linked ports (the same link reading as sub 35); it is not the expected port count from configuration time
37Flagsu8Read-onlySlave flags
38Port Physicsu16Read-onlyPort physical type
39Mailbox Protocolsu16Read-onlySupported mailbox protocols
40Diag History Supportedu8Read-onlyWhether the 0x10F3 diagnostic history is supported

0x9nnn — Slave detection information (ETG.1510 model)​

Each slave has one 0x9nnn object holding the actual information detected at runtime. The table below is the ETG.1510 object model; for the subindexes the Rust implementation actually provides, see the caution note above.

SubindexNameTypeRead/writeDescription
0Number of Entriesu8Read-onlyFixed at 32
1Station Addressu16Read-onlyActual configured address
5Vendor IDu32Read-onlyDetected vendor ID
6Product Codeu32Read-onlyDetected product code
7Revision Numberu32Read-onlyDetected revision number
8Serial Numberu32Read-onlyDetected serial number
32DL Statusu16Read-onlyDL Status register (ESC 0x0110)

0xAnnn — Slave diagnostic data (ETG.1510 model)​

Each slave has one 0xAnnn object holding live diagnostic data. It is updated automatically on every read. The table below is the ETG.1510 object model; for the subindexes the Rust implementation actually provides, see the caution note above (note that sub 1 is the u8 AL status, sub 2 reads and writes the AL status code, and sub 3 is the link quality).

SubindexNameTypeRead/writeDescription
0Number of Entriesu8Read-onlyFixed at 19
1AL Statusu16Read-onlyCurrent AL status
2AL Controlu16WritableWritten through to the slave
3Last AL Status Codeu16Read-onlyMost recent AL error code
4Link Conn. Statusu8Read-onlyTwo-bit connectivity status per port (2 bits per port, describing the connectivity of that port itself); it is not "which port of the parent this slave is attached to" — for that the only answer is slave.parent_port()
5Link Controlu8Read-onlyLink control
6-9Fixed Addr Conn. Port 0-3u16Read-onlyNot implemented in MasterObjectDictionary; returns None. Meaning: the fixed address of the slave connected to port p of this slave (p=0 the upstream parent, p=1..3 a downstream child). 0 = this port reports no connected slave, which is not the same as there definitely being none; use slave.parent_port() for the port of the parent this slave is attached to
10-13Frame Error Port 0-3u32Read-onlyFrame error count for each port
14Cyclic WC Error Counteru32Read-onlyCyclic working counter errors
15Slave Not Present Counteru32Read-onlyCount of slaves not present
16Abnormal State Change Counteru32Read-onlyCount of abnormal state changes
17Disable Auto Link Controlu8Read-onlyAutomatic link control disabled flag
18Last CoE/SoE Protocol Erroru32Read-onlyMost recent protocol error code
19New Diag Messagesu8Read-onlyWhether there are new diagnostic messages

0xF120 — Master diagnostic data​

SubindexNameTypeRead/writeDescription
0Number of Entriesu8Read-onlyFixed at 16
1Cyclic Lost Framesu32Read-onlyCyclic lost-frame count (a 5-second sliding-window value, not a percentage)
2Acyclic Lost Framesu32Read-onlyAcyclic lost-frame count (counts timed-out frames; also a 5-second sliding-window value)
3Cyclic Frames/Secondu32Read-onlyCyclic frames per second
4Acyclic Frames/Secondu32Read-onlyAcyclic frames per second (the current implementation does not fill this field; the reading is always 0)
5Master Stateu16Read-onlyCurrent EtherCAT state of the master
Subindex of Master State

ETG.1510 Table 13 defines Master State at subindex 16; this implementation returns it at subindex 5.

0xF200 — Diagnostic interface control​

SubindexNameTypeRead/writeDescription
0Number of Entriesu8Read-onlyFixed at 16
16Reset Diag Infou8WritableWriting 1 resets all diagnostic counters

Methods​

vendor_id() / product_code() / revision_number() / serial_number()​

pub fn vendor_id(&self) -> u32
pub fn product_code(&self) -> u32
pub fn revision_number(&self) -> u32
pub fn serial_number(&self) -> u32

Convenience accessors for the master identity (corresponding to 0x1018:01..04).

read_object()​

pub fn read_object(&self, index: u16, subindex: u8) -> Option<Vec<u8>>

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

Parameters:

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

Returns:

  • Option<Vec<u8>> — the raw data read; an unknown object returns None

write_object()​

pub fn write_object(&self, index: u16, subindex: u8, data: &[u8]) -> bool

Writes to the master object dictionary. Only some objects accept writes (see the read/write column of the object tables above).

Parameters:

  • index — object index
  • subindex — subindex
  • data — the data to write

Returns:

  • bool — true when the write succeeds

object_name()​

pub fn object_name(&self, index: u16) -> &str

Returns the name of an object. An unknown index returns "Unknown".

subindex_count()​

pub fn subindex_count(&self, index: u16) -> u8

Returns the subindex count of an object.

supported_object_indices()​

pub fn supported_object_indices(&self) -> Vec<u16>

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

Complete example​

let od = master.master_od();

// Iterate over the diagnostics data of all slaves
for i in 1..=master.slave_count() {
let diag_idx = 0xA000 | i;
let slave = master.slave(i);

// Slave name goes through the flat Slave method
let name = slave.name();

// Read the AL state (u8, subindex 1) and the AL status code (u16, subindex 2)
// Fall back to the default 0 on a read failure; do not let one failed object read drag down the whole diagnostic block
let al_status = od.read_object(diag_idx, 1)
.map(|d| d[0])
.unwrap_or(0);

let al_code = od.read_object(diag_idx, 2)
.map(|d| u16::from_le_bytes([d[0], d[1]]))
.unwrap_or(0);

// Link quality (u16, subindex 3)
let link_quality = od.read_object(diag_idx, 3)
.map(|d| u16::from_le_bytes([d[0], d[1]]))
.unwrap_or(0);

println!("从站{} [{}]: AL=0x{:02X}, Code=0x{:04X}, Quality={}", // Slave {} [{}]: AL=0x{:02X}, Code=0x{:04X}, Quality={}
i, name, al_status, al_code, link_quality);
}

// Reset all diagnostics
od.write_object(0xF200, 16, &[1]);

Naming conventions​

Method names in the Rust SDK follow Rust style (snake_case, verb first):

PurposeRust method
List the object indexes supported by the master ODsupported_object_indices()
Get a slave object descriptionOdList::get_object_description(mi, si, index) (returns OdObject metadata)
Get a slave entry descriptionOdList::get_entry_description(mi, si, index, sub) (returns ObjectEntry)
Extended SDO read/write with abort code and WKCCoEInstance::sdo_read_ex / sdo_write_ex (returns SdoReadResultEx / SdoWriteResultEx)
Bulk SDO readsCoEInstance::read_multiple synchronous + async wrapped with tokio spawn_blocking

The master OD (MasterObjectDictionary) itself exposes only read_object / write_object / object_name / subindex_count / supported_object_indices plus the four identity convenience methods; descriptors and extended reads/writes for the slave object dictionary are on the CoE page.