I want to find...

Search

Shares

Table of Content

EthercatDevice.pdoGetOutputBuffer()

[Ethercat Device]

Description

Get the memory pointer of the output process data for such EtherCAT slave device.

Syntax

uint8_t *pdoGetOutputBuffer();

Parameters

None.

Return Value

The memory pointer of the output process data for such EtherCAT slave device. If the returned value is NULL, it indicates an error code or that such slave device has no output process data.

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;

uint8_t *pointer;

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

void loop() {
  pointer[0] = 0x55;
  delay(500);
  pointer[0] = 0xaa;
  delay(1000);
}

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

Leave a Comment

Scroll to Top