EtherCATMaster
The core EtherCAT master class. It manages initialization, state management, slave control and PDO communication for the whole EtherCAT network.
Class structure
EtherCATMaster # Master instance
│
├── config -> MasterConfig # Communication configuration
├── diagnostics -> Optional[dict] # ETG.1510 basic diagnostics data
├── diagnostics_info -> MasterDiagnosticsInfo # Advanced diagnostics (frame counts, jitter, etc.)
├── logs -> LogView # Log view
├── master_od -> MasterObjectDictionary # ETG.1510 master object dictionary
├── mailbox_gateway -> MailboxGatewayService # ETG.8200 mailbox gateway
│
├── hotplug_bind_mode -> HotplugBindMode # Hot-plug bind mode (by identity / by position)
│
├── master[n] -> Slave # Slave access (1-based index)
│ │
│ ├── coe -> CoE # CANopen over EtherCAT (SDO read/write)
│ ├── soe -> SoE # Servo over EtherCAT
│ ├── foe -> FoE # File over EtherCAT
│ ├── eoe -> EoE # Ethernet over EtherCAT
│ ├── aoe -> AoE # ADS over EtherCAT
│ ├── voe -> VoE # Vendor over EtherCAT
│ ├── fsoe -> FSoE # Functional safety protocol
│ ├── cia402 -> CiA402 # Servo drive protocol
│ ├── pdo -> SlavePdo # PDO data read/write
│ ├── events -> SlaveEvents # Slave-level events
│ ├── dc_config -> DcConfig # DC distributed clock configuration
│ └── startup -> StartupParameterList # Startup parameters
│
├── on_pdo_cycle() # PDO cycle callback (regular worker thread, not the PDO cycle thread)
├── on_state_change() # Slave state change callback
├── on_emergency() # Emergency event callback
├── on_slave_discovery() # Slave discovery/loss callback
├── on_pdo_frame_loss() # PDO frame-loss callback
├── on_redundancy_mode_changed() # Redundancy mode change callback
├── set_dc_sync_lost_callback() # DC sync-lost callback
└── set_log_callback() # Log callback
Protocol instances (CoE, SoE and so on) are created lazily on demand and always return an object; whether a slave supports a protocol is judged through
slave.coe.is_supportedand the like (returnsOptional[bool]:coe/eoe/foecan giveTrue/False/None;aoe/voe/soe/fsoeonly produceTrue/None, whereNonemeans there is no positive evidence or the read failed, not "confirmed unsupported";EoEAdvancedonis_supported(mailbox_protocols=None)is the method that accepts a mailbox protocol bit field;slave.mdpreturnsNonewhen it is not supported). CiA402 can also be created independently throughCiA402Advanced, which supports PDO mapping scans.