EthercatDevice_XXX.pdoRead8()

[EthercatDevice_XXX]

Description

Read Slave Process Data Input. (unit8_t)

Format

uint8_t pdoRead8(uint16_t offset);

Syntax

EthercatDevice_XXX slave;
slave.pdoRead8();

Parameters

  • uint16_t offset: The ProcessData memory address.

Returns

uint8_t: 1-byte data value. If error, the return value is 0.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

void setup()
{
    Serial.begin(115200);

    master.begin();
    slave.attach(0, master);
    master.start();
}

void loop()
{
    /* Write value of byte offset 0 of slave's output process data. */
    slave.pdoWrite8(0, 0xFF);

    /* Read value of byte offset 0 of slave's input process data. */
    Serial.println(slave.pdoRead8(0), HEX);

    delay(100);
}

Libraries Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top