86Duino IDE EtherCAT 函式庫介紹
86Duino IDE EtherCAT 函式庫是一個基於工業 Arduino 開發環境且搭配即時系統(RTOS)的函式庫,為專門的 EtherCAT 主站通訊層解決方案,可透過通訊層和 EtherCAT 從站設備進行即時通訊作業。86Duino IDE 提供豐富的 Arduino 應用程式開發介面(API)來編程操作。
除 EtherCAT 主站通訊層外,亦可透過圖形化 EtherCAT 組態工具, 86EVA (EVA, EtherCAT-Based Virtual Arduino) 進行 EtherCAT 相關工業應用開發,其功能包含:
- 自動編譯成 Arduino 語言 (EtherCAT-based Virtual Arduino)
- Auto-scans EtherCAT devices on the EtherCAT network
- EtherCAT 主站相關:
- 設置 EtherCAT 主站物件名稱
- 配置 EtherCAT 主站週期時間
- 配置 Redundancy 選項
- 可選的 ENI 檔案功能
- EtherCAT 從站相關:
- 設置 EtherCAT 從站物件設定
- 配置 EtherCAT 從站 Alias 地址
- 配置 EtherCAT 從站 I/O 映射
- 顯示 EtherCAT 從站資訊
- 檢視內部監測資訊 (電壓、電流、溫度)
關於 86Duino IDE EtherCAT 函式庫的測量,請參考 QEC — EtherCAT Master 的基準.
86Duino IDE EtherCAT 函式庫功能
根據 EtherCAT 標準,86Duino IDE EtherCAT 函式庫支援 EtherCAT 主站功能如下表所列: (V: 已支援, △: 即將支援)

下面開始是 86Duino IDE EtherCAT 函式庫的使用說明。
Ethercat Class
用於 QEC 系列產品。
EthercatMaster 類別函式
用於 QEC 系列 EtherCAT 主站系統。
初始化相關函式:
存取從站資訊相關函式:
- getSlaveCount()
- getVendorID()
- getProductCode()
- getRevisionNumber()
- getSerialNumber()
- getAliasAddress()
- getSlaveNo()
控制相關函式:
EthercatDevice_XXX 類別通用函式
以下 API 仍在開發中,不建議使用。
存取從站資訊相關函式:
- getVendorID()
- getProductCode()
- getRevisionNumber()
- getSerialNumber()
- getAliasAddress()
- getSlaveNo()
- readSII()
- readSII8()
- readSII16()
- readSII32()
- writeSII()
- writeSII8()
- writeSII16()
- writeSII32()
PDO 存取相關函式:
EtherCAT 從站在每個週期內傳輸的過程數據(Process Data Objects,PDO)是應用程序期望循環更新或發送到從站的用戶數據。
EtherCAT 通用 Slave 驅動,讀/寫過程數據輸入/輸出。
- pdoBitWrite()
- pdoBitRead()
- pdoGetOutputBuffer()
- pdoGetInputBuffer()
- pdoWrite()
- pdoWrite8()
- pdoWrite16()
- pdoWrite32()
- pdoRead()
- pdoRead8()
- pdoRead16()
- pdoRead32()
CoE 通訊相關函式:
CANopen over EtherCAT (CoE) 協議允許配備 CANopen 的設備在基於 EtherCAT 的工業乙太網路上使用。
用於從目標 EtherCAT 主站訪問 EtherCAT 從站的 CoE 對象的非阻塞型 API。
- sdoDownload()
- sdoDownload8()
- sdoDownload16()
- sdoDownload32()
- sdoUpload()
- sdoUpload8()
- sdoUpload16()
- sdoUpload32()
- getODlist()
- getObjectDescription()
- getEntryDescription()
FoE 通訊相關函式:
File over EtherCAT (FoE) 是一種簡單的協議,可以在設備中訪問文件,並通過 EtherCAT 網路將統一的固件上傳到設備。
EthercatDevice_Generic 類別函式
適用各種品牌的 EtherCAT 設備泛用物件。
初始化相關函式:
EthercatDevice_Dmp 類別
用於 QEC 系列之 EtherCAT 從站設備。
EthercatDevice_QECRXXD 類別函式
QEC EtherCAT 從站數位 IO 模組。
EthercatDevice_QECRXXHU 類別函式
QEC EtherCAT 從站 HID 模組 (MPG + Keypad + LCM + RS232/485×2)。
EthercatDevice_QECRXXUN01 類別函式
QEC EtherCAT 從站 LCD 模組。
函式庫參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。