I want to find...

Search

Shares

Table of Content

EthercatDevice.pdoWrite32()

[Ethercat Device]

Description

Write 32-bit output process data which starting from the specified offset for such EtherCAT slave device.

Syntax

int pdoWrite32(uint32_t offset, uint32_t value);

Parameters

  • [in] uint32_t offset
    The offset value of output process data for such EtherCAT slave device.
  • [in] uint32_t value
    The 32-bit value to be written to output process data for such EtherCAT slave device.

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::start(). This function is non-blocking and can 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.pdoWrite32(0, 0x55555555);
  delay(500);
  slave.pdoWrite32(0, 0xAAAAAAAA);
  delay(1000);
}

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

Leave a Comment

Scroll to Top