I want to find...

Search

Shares

Table of Content

EthercatDevice.getProductCode()

[Ethercat Device]

Description

Get the product code of the EtherCAT slave device.

Syntax

uint32_t getProductCode();

Parameters

None.

Return Value

Return the product code of the EtherCAT slave device. If there is an error, return UINT32_MAX (232 – 1).

Comment

This function must be called after a successful execution of EthercatMaster::begin(). This function is non-blocking and can be called within the Cyclic Callback.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

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

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

  Serial.println(slave.getProductCode());
}

void loop() {
  // put your main code here, to run repeatedly:

}

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

Leave a Comment

Scroll to Top