I want to find...

Search

Shares

Table of Content

EthercatDevice_Dmp.getInvoiceNumber()

[EthercatDevice_Dmp]

Description

Get the invoice number.

Syntax

char *getInvoiceNumber(char *buffer = NULL);

Parameters

  • [out] char *buffer
    String data buffer, please ensure that the string array size is greater than or equal to 12. If this parameter is not provided, the internal data buffer will be used.

Return Value

Return a pointer to the invoice number string.

Comment

This function must be called after a successful execution of EthercatMaster::begin(). This function is blocking and cannot be called within the callback functions.

Example Code

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11DT0H slave;
char InvoiceNumber[12];

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

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

  Serial.print("Invoice Number: ");
  Serial.println(slave.getInvoiceNumber());
  Serial.print("Invoice Number: ");
  Serial.println(slave.getInvoiceNumber(InvoiceNumber));
  Serial.print("Invoice Number: ");
  Serial.println(InvoiceNumber);
}

void loop() {
  // ...
}

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

Leave a Comment

Scroll to Top