EtherCATMaster
The core EtherCAT master class. It manages initialization, state management, slave control and PDO communication for the whole EtherCAT network. It implements the AutoCloseable interface and supports try-with-resources.
Class structure
EtherCATMaster // master instance (AutoCloseable)
│
├── config() → MasterConfig // communication configuration
├── diagnostics() → MasterDiagnosticsInfo // master diagnostics
├── masterOD() → MasterObjectDictionary // master object dictionary
├── mailboxGateway() → MailboxGatewayService // mailbox gateway
├── slaveTopology() → SlaveTopology // slave topology
├── logs() → LogManager.LogView // log view
│
├── slaves() → List<Slave> // slave list
│ │
│ ├── PDO() → PDO // PDO data read/write
│ ├── diagnostics() → SlaveStats // diagnostic statistics
│ ├── DC() → DC // DC synchronization configuration
│ ├── topology() → SlaveTopology // topology information
│ ├── startupParameters() → StartupParameterList // startup parameters
│ │
│ ├── coe() → CoE // CANopen over EtherCAT
│ ├── cia402() → CiA402 // servo drive protocol (direct access)
│ ├── cia401() → CiA401 // generic I/O protocol (direct access)
│ ├── 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
│ └── MDP() → MDP // modular device
│
└── events() → MasterEvents // event collection
├── addProcessDataCyclicSyncListener(...) // PDO cycle callback (synchronous, for same-cycle real-time control such as FSoE)
├── addStateChangedListener(...) // master state change
├── addSlaveStateChangedListener(...) // slave state change
├── addEmergencyEventListener(...) // emergency event
├── addSlaveOfflineListener(...) / addSlaveOnlineListener(...)
├── addSlaveIdentityMismatchListener(...) // slave identity mismatch
├── addSlavePortLinkChangedListener(...) // slave port link change
├── addPDOFrameLossListener(...) // PDO frame loss
├── addDCSyncLostListener(...) // DC synchronization lost
└── addRedundancyModeChangedListener(...) // redundancy mode change
PDO process data is exchanged by the real-time runtime. The recommended path is to map once after entering OP with
pdo.inputsMapping(InPdo.class)/pdo.outputsMapping(OutPdo.class); the returnedStructuremaps directly onto the real-time process image.copyInputPdo/writeOutputPdoare whole-frame snapshot alternatives. The asynchronous PDO cycle callback and the input data change event have been removed; to notice input changes per cycle, pollcopyInputPdoand compare with the previous cycle.
All child objects are created lazily and are instantiated automatically on first access. CiA402 and CiA401 are reached directly through
slave.cia402()/slave.cia401(); there is no need to get CoE first. Every entry point in the diagram above uses Java camelCase naming (config()/slaves()/coe()and so on).