[EthercatDevice_XXX]
描述
(CoE) Write the object to the EtherCAT Slave device. (uint8_t)
格式
int sdoDownload8(uint16_t od_index, uint8_t od_subindex, uint8_t value, uint32_t timeout_us = ECAT_DEFAULT_COE_TIMEOUT_US);
語法
EthercatDevice_XXX slave;
slave.sdoDownload8();
參數
uint16_t od_index
:CANOpen 物件索引。uint8_t od_subindex
:CANOpen 物件子索引。uint8_t value
:: 1-byte 的數據。uint32_t timeout_us
:超時,單位為一微秒。
回傳
Int:0表示成功;如果返回值小於0表示錯誤。
範例
#include "Ethercat.h" EthercatMaster master; EthercatDevice_Generic slave; void setup() { Serial.begin(115200); while (!Serial); master.begin(); slave.attach(0, master); /* Write 0x08 to the object with index 0x6060. */ slave.sdoDownload8(0x6060, 0x00, 0x08); /* Read value from the object with index 0x6061. */ Serial.prinln(slave.sdoUpload8(0x6061, 0x00)); master.start(); } void loop() {}
函式庫參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。