[Ethercat Device]
Description
Write 16-bit value to the specified object for such EtherCAT slave device.
Syntax
int sdoDownload16(uint16_t od_index, uint8_t od_subindex, uint16_t value, uint32_t timeout_us = 100000);
Parameters
[in] uint16_t od_index
Index of the object.[in] uint8_t od_subindex
Subindex of the object.[in] uint16_t value
The 16-bit value to be written to object.[in] uint32_t timeout_us
Timeout in microseconds.
Return Value
Return an error code. If the returned value is zero, it indicates a successful execution of this function.
Comment
This function must be called after a successful execution of EthercatMaster::begin()
. This function is blocking and cannot be called within the Cyclic Callback.
Example
#include "Ethercat.h" EthercatMaster master; EthercatDevice_Generic slave; void setup() { master.begin(); slave.attach(0, master); master.start(1000000); } void loop() { slave.sdoDownload16(0x6040, 0x00, 0x000F); delay(1000); }
Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.