我想找...

搜尋

函式庫參考

目錄

EthercatDevice.sdoDownload64()

[Ethercat Device]

描述

Write 64-bit value to the specified object for such EtherCAT slave device.

語法

int sdoDownload64(uint16_t od_index, uint8_t od_subindex, uint64_t value, uint32_t timeout_us = 100000);

參數

  • [in] uint16_t od_index
    Index of the object.
  • [in] uint8_t od_subindex
    Subindex of the object.
  • [in] uint64_t value
    The 64-bit value to be written to object.
  • [in] uint32_t timeout_us
    Timeout in microseconds.

回傳值

回傳錯誤碼。若回傳值為零,表示此函式執行成功。

備註

This function must be called after a successful execution of EthercatMaster::begin(). This function is blocking and cannot be called within the Cyclic Callback.

範例

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

void setup() {
  master.begin();
  slave.attach(0, master);
  master.start(1000000);
}

void loop() {
  slave.sdoDownload64(0x5000, 0x00, 100000);
  delay(1000);
  slave.sdoDownload64(0x5000, 0x00, 0);
  delay(1000);
}

Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.

返回頂端