Structure de l'API du maître
L'interface centrale du maître EtherCAT : elle gère l'initialisation, la gestion des états, la commande des esclaves et la communication PDO sur l'ensemble du réseau EtherCAT.
Structure de l'API
Chaque fonction identifie l'instance maître par un uint16_t master_index (renvoyé par Initialize()).
Les fonctions publiques sont incluses via ethercat.h et appelées directement avec l'index du maître (ni handle DLL, ni table de pointeurs de fonction) :
C SDK (ethercat.h) // appels directs, sans handle DLL
│
├── Cycle de vie: Initialize, Dispose, Start, Stop
├── Réseau: SetNetwork, GetNetworkInfo, QuickSlaveCount
├── Automate à états: SetState, SetStateSequence, SetStateWithTimeout
├── IO: CopySlaveInputPdo, WriteSlaveOutputPdo
│
├── Propriétés de l'esclave: GetSlaveVendorId, GetSlaveName, GetSlaveState...
│ ├── Lecture/écriture PDO: CopySlaveInputPdo, WriteSlaveOutputPdo
│ ├── CoE/SDO: sdo_read_typed_ex, sdo_write_typed_ex, sdo_read_u16
│ │ ├── CiA 402: CiA402_Enable, CiA402_SetMode, CiA402_ParseState
│ │ └── EMCY: EmcyGetHistory, EmcyClearHistory
│ ├── SoE: soe_read_u16, soe_write_u16, soe_read_string
│ ├── FoE: foe_upload, foe_download
│ ├── EoE: eoe_ping, eoe_set_receive_hook
│ ├── AoE: aoe_sub_create, aoe_sub_add
│ ├── VoE: voe_register_notification
│ ├── FSoE: fsoe_manager_create, fsoe_manager_get_info
│ ├── DC: SetSyncBySlaveIndex, GetSlaveHasDC
│ └── Paramètres de démarrage: AddStartupParameter, ClearStartupParameters, ApplyStartupParameters
│
├── Configuration: LoadConfigJson, AutoConfigureSM, EcInit, EcClose
├── DC: ConfigureDCAll, EnableDriftCompensation
├── Gestion des groupes: SetSlaveGroup, SetGroupCycleDivider
├── Redondance: GetRedundancyStatus
├── Diagnostics: GetDiagnosticsSnapshot, GetBreakPoints
├── Registres / chien de garde: WriteSlaveRegister, ReadSlaveRegister, SetSlaveWatchdog
├── Passerelle de boîte aux lettres: gateway_create / gateway_start / gateway_stop / gateway_get_statistics(master/gateway.h)
│
├── Rappels d'événements:
│ ├── SetLogCallback
│ ├── RegisterProcessDataCyclicCallbackSync
│ ├── RegisterSlaveStateChangeCallbackSync / RegisterSlaveStateChangeCallbackAsync
│ ├── RegisterEmergencyEventCallback
│ ├── RegisterSlaveDiscoveryCallbackSync / RegisterSlaveDiscoveryCallbackAsync
│ ├── RegisterPDOFrameLossCallback
│ ├── RegisterRedundancyModeChangedCallback
│ ├── RegisterSlavePreOpReconfigCallback
│ └── SetDCSyncLostCallback