EthercatDevice_QECRXXD.attach()

[EthercatDevice_QECRXXD]

Description

Specify the EC-Slave number and mount it on the EC-Master.

Class Modules

class EthercatDevice_QECR00DC4D;    /* 12 Inputs,  4 Outputs. RJ45 power [0, 0]. With broken wire detector. */
class EthercatDevice_QECR00D4CD;    /*  4 Inputs, 12 Outputs. RJ45 power [0, 0]. With broken wire detector. */
class EthercatDevice_QECR11D0FS;    /*  0 Inputs, 16 Outputs. RJ45 power [1, 1]. */
class EthercatDevice_QECR00D0FS;    /*  0 Inputs, 16 Outputs. RJ45 power [0, 0]. */
class EthercatDevice_QECR11DF0D;    /* 16 Inputs,  0 Outputs. RJ45 power [1, 1]. With broken wire detector. */
class EthercatDevice_QECR00DF0D;    /* 16 Inputs,  0 Outputs. RJ45 power [0, 0]. With broken wire detector. */
class EthercatDevice_QECR11D88S;    /*  8 Inputs,  8 Outputs. RJ45 power [1, 1]. */
class EthercatDevice_QECR00D88D;    /*  8 Inputs,  8 Outputs. RJ45 power [0, 0]. With broken wire detector. */
class EthercatDevice_QECR11D88D;    /*  8 Inputs,  8 Outputs. RJ45 power [1, 1]. With broken wire detector. */
class EthercatDevice_QECR11D0FH;    /*  0 Inputs, 16 Outputs. RJ45 power [1, 1]. High speed digital I/O. */
class EthercatDevice_QECR11DF0H;    /* 16 Inputs,  0 Outputs. RJ45 power [1, 1]. High speed digital I/O. */

Format

int attach(uint16_t slave_id, EthercatMaster &master, EthercatAttachMode mode = ECAT_SLAVE_NO);

Syntax

EthercatDevice_QECRXXD slave;
slave.attach(0, master);

Parameters

  • uint16_t slave_id
    • ECAT_SLAVE_NO: EtherCAT Slave Number.
    • ECAT _ALIAS_ADDRESS: EtherCAT Slave Alias Address.
  • EthercatMaster &master
  • EthercatAttachMode mode
    • ECAT_SLAVE_NO
    • ECAT_ALIAS_ADDRESS

Returns

Int: 0 for successful; if the return value is smaller than 0 means error.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11D0FS slave;

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

void loop() {
    slave.digitalWrite(0, HIGH);
    delay(4000);
    slave.digitalWrite(0, LOW);
    delay(1000);
}

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