EthercatMaster.getSerialNumber()

[EthercatMaster]

Description

Get the EtherCAT Slave Serial Number on the EtherCAT bus.

Format

uint32_t getSerialNumber(uint16_t slave_no);

Syntax

EthercatMaster master;
master. getSerialNumber();

Parameters

  • unit16_t slave_no: the Slave position port that you want to get.

Returns

uint32_t: the EtherCAT Slave Serial Number on the EtherCAT bus.

Example

#include "Ethercat.h"

EthercatMaster master;

void setup(void) {
    unit32_t slaveserialnum;
uint16_t slavecount=1;
    
    Serial.begin(115200);
    while (!Serial);
    
    master.begin();
    
    slaveserialnum = master. getSerialNumber(slavecount);
    Serial.println(slaveserialnum);
}

void loop() {}

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