我想找...

搜尋

分享

目錄

EthercatDevice.writeSII()

[Ethercat Device]

描述

Write the data of SII EEPROM of a certain size which starting from the specified offset for such EtherCAT slave device.

語法

int writeSII(uint32_t offset, void *data, size_t len, uint32_t timeout_ms = 500);

參數

  • [in] uint32_t offset
    The offset value of SII EEPROM for such EtherCAT slave device.
  • [in] void *data
    The data buffer for writing SII EEPROM.
  • [in] size_t len
    The size of the data buffer for writing SII EEPROM.
  • [in] uint32_t timeout_ms
    Timeout in milliseconds.

回傳值

Return an error code. If the returned value is zero, it indicates a successful execution of this function.

備註

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;

uint8_t buffer[4] = {0x00, 0x55, 0xAA, 0xFF};

void setup() {
  master.begin();
  slave.attach(0, master);
  slave.writeSII(64, buffer, 4);
}

void loop() {
  // ...
}

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

返回頂端