[Ethercat Device]
描述
Read 64-bit value from the specified object for such EtherCAT slave device.
語法
uint64_t sdoUpload64(uint16_t od_index, uint8_t od_subindex, uint32_t timeout_us = 100000);
參數
[in] uint16_t od_index
Index of the object.[in] uint8_t od_subindex
Subindex of the object.[in] uint32_t timeout_us
Timeout in microseconds.
回傳值
Return the 64-bit value.
備註
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() {
Serial.begin(115200);
master.begin();
slave.attach(0, master);
master.start(1000000);
}
void loop() {
uint64_t value = slave.sdoUpload64(0x5000, 0x00);
uint32_t highPart = (uint32_t)(value >> 32);
uint32_t lowPart = (uint32_t)(value & 0xFFFFFFFF);
Serial.print("Value: ");
Serial.print(highPart, HEX);
Serial.print(lowPart, HEX);
Serial.println();
delay(1000);
}Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.