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().
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
| Category | Index | Name | Subindexes | Read/write | Description |
|---|---|---|---|---|---|
| Basic | 0x1000 | Device Type | 0 | Read-only | 0x00001389 (EtherCAT Master) |
| Basic | 0x1008 | Device Name | 0 | Read-only | "Darra EtherCAT Master" |
| Basic | 0x1009 | Hardware Version | 0 | Read-only | "1.0" |
| Basic | 0x100A | Software Version | 0 | Read-only | SDK version |
| Identity | 0x1018 | Identity Object | 4 | Read-only | Master identity information (see the subindex table below) |
| Slave | 0x8nnn | Configuration Data | 40 | Read-only | Configuration data of slave n |
| Slave | 0x9nnn | Information Data | 32 | Read-only | Detected information of slave n |
| Slave | 0xAnnn | Diagnosis Data | 19 | Partially writable | Diagnostic data of slave n |
| Scan | 0xF002 | Detect Modules | 3 | Read-only | Slave scan status |
| Diagnostics | 0xF120 | Master Diag Data | 16 | Read-only | Master diagnostic data |
| Diagnostics | 0xF200 | Diag Interface Control | 16 | Writable | Diagnostic interface control |
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.
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):
| Object | Implemented subindexes |
|---|---|
0x8nnn | 0 (Count=40), 1 Vendor ID, 2 Product Code, 3 Revision Number, 4 Serial Number |
0x9nnn | 0 (Count=32), 1 AL status (u8), 2 AL status code (u16) |
0xAnnn | 0 (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) |
0xF002 | 0, 1, 2 (number of slaves found by the scan, u16), 3 |
0xF120 | 0 (Count=16), 1-4 (lost-frame counters / frame rate), 5 Master State |
0xF200 | 0 (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)
| Subindex | Name | Type | Read/write | Value | Description |
|---|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | 4 | Fixed |
| 1 | Vendor ID | u32 | Read-only | 0x00001164 | Assigned by ETG, fixed value |
| 2 | Product Code | u32 | Read-only | 0x00000001 | Fixed value |
| 3 | Revision Number | u32 | Read-only | Automatic | Derived automatically from the runtime version |
| 4 | Serial Number | u32 | Read-only | Automatic, incrementing | Each 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.
| Subindex | Name | Type | Read/write | Description |
|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | Fixed at 40 |
| 1 | Fixed Station Address | u16 | Read-only | Configured address (ConfigAddr) |
| 2 | Type | String | Read-only | Device type string |
| 3 | Name | String | Read-only | Device name |
| 4 | Device Type | u32 | Read-only | Device type code |
| 5 | Vendor ID | u32 | Read-only | Vendor ID |
| 6 | Product Code | u32 | Read-only | Product code |
| 7 | Revision Number | u32 | Read-only | Revision number |
| 8 | Serial Number | u32 | Read-only | Serial number |
| 33 | Mailbox Out Size | u16 | Read-only | SM0 mailbox output size |
| 34 | Mailbox In Size | u16 | Read-only | SM1 mailbox input size |
| 35 | Link Status | u8 | Read-only | Port 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 |
| 36 | Link Preset | u8 | Read-only | Port 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 |
| 37 | Flags | u8 | Read-only | Slave flags |
| 38 | Port Physics | u16 | Read-only | Port physical type |
| 39 | Mailbox Protocols | u16 | Read-only | Supported mailbox protocols |
| 40 | Diag History Supported | u8 | Read-only | Whether 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.
| Subindex | Name | Type | Read/write | Description |
|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | Fixed at 32 |
| 1 | Station Address | u16 | Read-only | Actual configured address |
| 5 | Vendor ID | u32 | Read-only | Detected vendor ID |
| 6 | Product Code | u32 | Read-only | Detected product code |
| 7 | Revision Number | u32 | Read-only | Detected revision number |
| 8 | Serial Number | u32 | Read-only | Detected serial number |
| 32 | DL Status | u16 | Read-only | DL 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).
| Subindex | Name | Type | Read/write | Description |
|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | Fixed at 19 |
| 1 | AL Status | u16 | Read-only | Current AL status |
| 2 | AL Control | u16 | Writable | Written through to the slave |
| 3 | Last AL Status Code | u16 | Read-only | Most recent AL error code |
| 4 | Link Conn. Status | u8 | Read-only | Two-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() |
| 5 | Link Control | u8 | Read-only | Link control |
| 6-9 | Fixed Addr Conn. Port 0-3 | u16 | Read-only | Not 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-13 | Frame Error Port 0-3 | u32 | Read-only | Frame error count for each port |
| 14 | Cyclic WC Error Counter | u32 | Read-only | Cyclic working counter errors |
| 15 | Slave Not Present Counter | u32 | Read-only | Count of slaves not present |
| 16 | Abnormal State Change Counter | u32 | Read-only | Count of abnormal state changes |
| 17 | Disable Auto Link Control | u8 | Read-only | Automatic link control disabled flag |
| 18 | Last CoE/SoE Protocol Error | u32 | Read-only | Most recent protocol error code |
| 19 | New Diag Messages | u8 | Read-only | Whether there are new diagnostic messages |
0xF120 — Master diagnostic data
| Subindex | Name | Type | Read/write | Description |
|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | Fixed at 16 |
| 1 | Cyclic Lost Frames | u32 | Read-only | Cyclic lost-frame count (a 5-second sliding-window value, not a percentage) |
| 2 | Acyclic Lost Frames | u32 | Read-only | Acyclic lost-frame count (counts timed-out frames; also a 5-second sliding-window value) |
| 3 | Cyclic Frames/Second | u32 | Read-only | Cyclic frames per second |
| 4 | Acyclic Frames/Second | u32 | Read-only | Acyclic frames per second (the current implementation does not fill this field; the reading is always 0) |
| 5 | Master State | u16 | Read-only | Current EtherCAT state of the master |
ETG.1510 Table 13 defines Master State at subindex 16; this implementation returns it at subindex 5.
0xF200 — Diagnostic interface control
| Subindex | Name | Type | Read/write | Description |
|---|---|---|---|---|
| 0 | Number of Entries | u8 | Read-only | Fixed at 16 |
| 16 | Reset Diag Info | u8 | Writable | Writing 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 as0x1018,0x8001,0xA001)subindex— subindex
Returns:
Option<Vec<u8>>— the raw data read; an unknown object returnsNone
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 indexsubindex— subindexdata— the data to write
Returns:
bool—truewhen 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):
| Purpose | Rust method |
|---|---|
| List the object indexes supported by the master OD | supported_object_indices() |
| Get a slave object description | OdList::get_object_description(mi, si, index) (returns OdObject metadata) |
| Get a slave entry description | OdList::get_entry_description(mi, si, index, sub) (returns ObjectEntry) |
| Extended SDO read/write with abort code and WKC | CoEInstance::sdo_read_ex / sdo_write_ex (returns SdoReadResultEx / SdoWriteResultEx) |
| Bulk SDO reads | CoEInstance::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.