I want to find...

Search

Shares

Table of Content

EthercatDevice.detach()

[Ethercat Device]

Description

Uninstall the slave object.

Syntax

int detach();

Parameters

None.

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 EthercatDevice_Generic::attach().
WARNING: Prohibited from being called within the callback functions.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

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

  delay(3000);
  slave.detach();
  master.end();
}

void loop() {
  // do something here.
}

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

Leave a Comment

Scroll to Top